Merge "Issue #2071 - refactor data delivery help dialogs" into development

Former-commit-id: a18a364f8e [formerly 791f9e93aa] [formerly a18a364f8e [formerly 791f9e93aa] [formerly ac6df52b0d [formerly 14f9efda965a700d9e701e36a3ff2e56d78b1dba]]]
Former-commit-id: ac6df52b0d
Former-commit-id: bc92d23e99 [formerly a034c677d1]
Former-commit-id: fa9c7e1bdb
This commit is contained in:
Lee Venable 2013-06-06 14:06:53 -05:00 committed by Gerrit Code Review
commit 5f11afd978
16 changed files with 985 additions and 537 deletions

View file

@ -0,0 +1,83 @@
<Help>
<!-- Help dialog's title -->
<title>Dataset Discovery Browser Help</title>
<!-- A help entry -->
<helpEntry>
<!-- Help entry heading, bold font -->
<header>
The Dataset Discovery Browser allows users to find Datasets using a filtering scheme.
</header>
<!-- Help entry text, normal font. Line breaks in text are passed through to display -->
<text>
First is the optional Area filter. Selecting an area only displays datasets that have coverage over the area. Next select and available Data Type. Move the data type to the selected column using the arrows. Next select from the filtering options. Filters include Data Provider, Dataset, Level, and Parameter. Click the arrows to the left of the Filter titles to expand the filter selection sections. After Filters are selected, click Update Results to load the list of Datasets in the table. Select a Dataset and click the Subset... button. Optionally, select Subset information. Enter a Subset Name. Click the Subscribe button to subscribe to the subset. Click the Query button to find details about the subset.
</text>
</helpEntry>
<helpEntry>
<header>
File Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
New Configuration...
</header>
<text>
Clear the current configuration settings.
</text>
</helpEntry>
<helpEntry>
<header>
Load Configuration...
</header>
<text>
Load a previously saved configuration file. Select from the Available Configuration Files list and click the Load button to load a configuration file. Use the Preview button to view the XML associated with the configuration file.
</text>
</helpEntry>
<helpEntry>
<header>
Save Configuration
</header>
<text>
Save the current configuration settings to the most recently saved file name. The first time Save Configuration is accessed, select to save either at the User or Site level and enter a file name. Click the Save button to save the file. Use the Load Configuration menu item to load a saved configuration.
</text>
</helpEntry>
<helpEntry>
<header>
Save Configuration As...
</header>
<text>
Save the current configuration settings to a named file that may be loaded in the future. In the Save Configuration dialog select to save either at the User or Site level and enter a file name. Click the <b>Save</b> button to save the file. Use the Load Configuration menu item to load a saved configuration.
</text>
</helpEntry>
<helpEntry>
<header>
Delete Configuration...
</header>
<text>
Delete a saved configuration file.
</text>
</helpEntry>
<helpEntry>
<header>
Exit
</header>
<text>
Exit the table.
</text>
</helpEntry>
<helpEntry>
<header>
Settings Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Tooltips
</header>
<text>
Turn on mouseover tooltips for the controls.
</text>
</helpEntry>
</Help>

View file

@ -0,0 +1,134 @@
<Help>
<!-- Help dialog's title -->
<title>Notification Center Help</title>
<!-- A help entry -->
<helpEntry>
<!-- Help entry heading, bold font -->
<header>
The Notification Center Table allows a user to view and delete data delivery notifications.
</header>
<!-- Help entry text, normal font. Line breaks in text are passed through to display -->
<text />
</helpEntry>
<helpEntry>
<header>
File Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Set as Default
</header>
<text>
Set the current configuration settings to be the default settings for the table. When the table is opened the saved default settings are applied.
</text>
</helpEntry>
<helpEntry>
<header>
Load Configuration...
</header>
<text>
Load a previously saved configuration file. Select from the Available Configuration Files list and click the Load button to load a configuration file. Use the Preview button to view the XML
associated with the configuration file.
</text>
</helpEntry>
<helpEntry>
<header>
Save Configuration
</header>
<text>
Save the current configuration settings to the most recently saved file name. The first time Save Configuration is accessed, select to save either at the User or Site level and enter a file name. Click the Save button to save the file. Use the Load Configuration menu item to load a saved configuration.
</text>
</helpEntry>
<helpEntry>
<header>
Save Configuration As...
</header>
<text>
Save the current configuration settings to a named file that may be loaded in the future. In the Save Configuration dialog select to save either at the User or Site level and enter a file name. Click the Save button to save the file. Use the Load Configuration menu item to load a saved configuration.
</text>
</helpEntry>
<helpEntry>
<header>
Delete Configuration...
</header>
<text>
Delete a saved configuration file.
</text>
</helpEntry>
<helpEntry>
<header>
Exit
</header>
<text>
Close the Notification Center.
</text>
</helpEntry>
<helpEntry>
<header>
Edit Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Find...
</header>
<text>
Find and highlight items in the table using the Find dialog. The Case Sensitive option allows a user to search text that is capitalization sensitive. The Exclude option allows a user to search the table for items that exclude the entered text. The Case Sensitive and Exclude options may be used in conjunction with another. The Column Selection grouping allows users to search a specific column in the table. After the search criteria has been selected, click the Find Next button to perform the search. The Highlight All button highlights all the rows matching the find criteria. Close the Find dialog using the Close button.
</text>
</helpEntry>
<helpEntry>
<header>
Delete by Priority
</header>
<text>
Delete all rows in the table having a specific priority. (Note: Notifications only deleted from the user view and not permanently deleted from the database.)
</text>
</helpEntry>
<helpEntry>
<header>
Delete Older Than Selected
</header>
<text>
Delete all rows in the table having a date in the Time column that is older than the currently highlighted row. (Note: Notifications only deleted from the user view and not permanently deleted from the database.)
</text>
</helpEntry>
<helpEntry>
<header>
Delete Notifications
</header>
<text>
Delete the currently highlighted row(s) in the table. (Note: Notifications only deleted from the user view and not permanently deleted from the database.)
</text>
</helpEntry>
<helpEntry>
<header>
Settings Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Configure Table...
</header>
<text>
The Initial Startup Configuration items are set when the table is opened. Check the Load All Messages check box to display all messages in the table that are contained in the database. Enter a number of messages or hours amount in the Load Last spinner to select the amount of messages or number of hours of messages to display in the table. Set the Initial Sort Column and either Sort Ascending or Sort Descending to sort the table by a specific column upon opening.
The Display Configuration items refresh the table upon clicking OK. Select the number of Rows Per Page using the selection drop down. Select the image setting for the Priority table column using the radio buttons. Select to make columns hidden or visible using the arrows provided. After making selections, click the OK button to configure the table. (Note: Unless the configuration is set to the default or saved, changes will be lost when the table is closed.)
</text>
</helpEntry>
<helpEntry>
<header>
Filter Table...
</header>
<text>
A user may filter the table by user, by subscription or by priority. In the Filter by User section, the list of available user names are in the Available Users column. If users are moved to the Selected Users list, the corresponding columns containing those user names will be displayed in the Notification Table. Use the arrows to move users back and forth from the Available Users list to the Selected Users list. (Note: User names are not duplicated and appear only once either in the Available or Selected lists.) The Always include my notifications check box may be used to keep the currently logged in user in the Selected Users column.
In the Filter by Subscription section, the list of available subscription names are in the Available Subscriptions column. If subscriptions are moved to the Selected Subscriptions list the corresponding columns containing those subscription names will be displayed in the Notification Table. Use the arrows to move subscriptions back and forth from the Available Subscriptions list to the Selected Subscriptions list. (Note: Subscription names are not duplicated and appear only once either in the Available or Selected lists.)
In the Filter by Priority section, select which columns containing specific priorities to display using the checkboxes.
</text>
</helpEntry>
</Help>

View file

@ -0,0 +1,64 @@
<Help>
<!-- Help dialog's title -->
<title>Subscription Approval Help</title>
<!-- A help entry -->
<helpEntry>
<!-- Help entry heading, bold font -->
<header>
The Subscription Approval Dialog allows an authorized user to approve or deny subscriptions.
</header>
<!-- Help entry text, normal font. Line breaks in text are passed through to display -->
<text>
</text>
</helpEntry>
<helpEntry>
<header>
File Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Exit
</header>
<text>
Close the dialog.
</text>
</helpEntry>
<helpEntry>
<header>
View Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Details...
</header>
<text>
View the details of the highlighted subscription.
</text>
</helpEntry>
<helpEntry>
<header>
Action Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Approve Selected
</header>
<text>
Approve the highlighted subscription.
</text>
</helpEntry>
<helpEntry>
<header>
Deny Selected
</header>
<text>
Deny the highlighted subscription
</text>
</helpEntry>
</Help>

View file

@ -0,0 +1,137 @@
<Help>
<!-- Help dialog's title -->
<title>Subscription Manager Help</title>
<!-- A help entry -->
<helpEntry>
<!-- Help entry heading, bold font -->
<header>
The Subscription Manager Table allows a user to add, edit, copy, view, and delete data delivery subscriptions.
</header>
<!-- Help entry text, normal font. Line breaks in text are passed through to display -->
<text>
First is the optional Area filter. Selecting an area only displays datasets that have coverage over the area. Next select and available Data Type. Move the data type to the selected column using the arrows. Next select from the filtering options. Filters include Data Provider, Dataset, Level, and Parameter. Click the arrows to the left of the Filter titles to expand the filter selection sections. After Filters are selected, click Update Results to load the list of Datasets in the table. Select a Dataset and click the Subset... button. Optionally, select Subset information. Enter a Subset Name. Click the Subscribe button to subscribe to the subset. Click the Query button to find details about the subset.
</text>
</helpEntry>
<helpEntry>
<header>
File Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
New Subscription...
</header>
<text>
The New Subscription menu option opens the Dataset Discovery Browser.
</text>
</helpEntry>
<helpEntry>
<header>
New Group...
</header>
<text>
The New Group menu option allows the user to create a new subscription group. First enter a group name. Next select the Subscription Duration, Active Period, and Areal Coverage. Finally select which subscriptions to add to the new group.
</text>
</helpEntry>
<helpEntry>
<header>
Refresh Table
</header>
<text>
Refresh the table data.
</text>
</helpEntry>
<helpEntry>
<header>
Approve Pending Subscriptions...
</header>
<text>
Opens the Subscription Approval dialog.
</text>
</helpEntry>
<helpEntry>
<header>
Exit
</header>
<text>
Close the dialog.
</text>
</helpEntry>
<helpEntry>
<header>
Edit Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Edit Subscription...
</header>
<text>
Highlight a row in the table to edit. Modify the Subscription Delivery Options, the Subscription Duration, the Subscription Active Period, the Subscription Priority or the additional Subscription Information.
Subscription Duration sets the start and expiration times for subscription delivery. Use the No Expiration radio button to continue to receive the subscription.
The Subscription Active Period may be used to select a specified time range for the subscription to be active. (Note: The active period does not include the year.) The Subscription Priority sets the order of subscription fulfillment and may be set to High (1), Default (2), or Low (3).
The Subscription Information allows the Description to be modified. The Subscription Name may not be modified.
Click OK to perform the edit.
</text>
</helpEntry>
<helpEntry>
<header>
Copy Subscription...
</header>
<text>
Highlight a row in the table to copy. Enter a New Subscription Name. Click OK to perform the copy.
</text>
</helpEntry>
<helpEntry>
<header>
Delete Subscription...
</header>
<text>
Highlight a row(s) in the table to delete. Click Yes to perform the deletion.
</text>
</helpEntry>
<helpEntry>
<header>
Edit Group...
</header>
<text>
Edit the group settings. Select a group to edit, change the settings, click OK to save the edit.
</text>
</helpEntry>
<helpEntry>
<header>
Delete Group...
</header>
<text>
Select a group to delete and click OK to delete the group.
</text>
</helpEntry>
<helpEntry>
<header>
Settings Menu
</header>
<text />
</helpEntry>
<helpEntry>
<header>
Configure Table...
</header>
<text>
The Table Column Configuration Settings allow a user to hide and make visible table columns. The list of Hidden Columns is located on the left and the Visible Columns list is located on the right. If columns are moved to the Visible Columns list, the corresponding columns will be displayed in the Notification Table. Use the right and left arrows to move column names back and forth from the Hidden Columns list to the Visible Columns list. Use the up and down arrows to change the order of the visible columns as seen in the table. (Note: Column names are not duplicated and appear only once either in the Hidden or Visible lists.) After making selections, click the OK button to configure the table. (Note: Unless the configuration is set to the default or saved, changes will be lost when the table is closed.)
</text>
</helpEntry>
<helpEntry>
<header>
Tooltips
</header>
<text>
Turns on the mouseover tooltips for the dialog's controls.
</text>
</helpEntry>
</Help>

View file

@ -77,6 +77,7 @@ import com.raytheon.uf.viz.datadelivery.filter.MetaDataManager;
import com.raytheon.uf.viz.datadelivery.filter.config.FilterManager;
import com.raytheon.uf.viz.datadelivery.filter.config.xml.FilterSettingsXML;
import com.raytheon.uf.viz.datadelivery.filter.config.xml.FilterTypeXML;
import com.raytheon.uf.viz.datadelivery.help.HelpManager;
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
import com.raytheon.uf.viz.datadelivery.subscription.subset.SubsetManagerDlg;
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryGUIUtils;
@ -116,6 +117,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jan 14, 2012 1437 bgonzale Clear filters when creating a new configuration.
* May 15, 2013 1040 mpduff Put DataDeliveryGUIUtils.markNotBusyInUIThread in finally block.
* Jun 04, 2013 223 mpduff Add data type to filters.
* Jun 06, 2013 2030 mpduff Updates to help.
*
* </pre>
*
@ -129,6 +131,9 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(DataBrowserDlg.class);
/** File containing help text */
private final String DATA_BROWSER_HELP_FILE = "help/dataBrowserHelp.xml";
/** Window Title string. */
private final String WINDOW_TITLE = "Dataset Discovery Browser";
@ -140,9 +145,6 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
private static final String DEFAULT_CONFIG = FileUtil.join(CONFIG_PATH,
"DefaultBrowserConfig.xml");
/** Help Dialog */
private final DataBrowserHelpDlg help = null;
/** Filter expand bar. */
private FilterExpandBar filterExpandBar;
@ -714,14 +716,14 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
* Handle the help display dialog.
*/
private void handleHelp() {
if (help == null || help.isDisposed()) {
DataBrowserHelpDlg help = new DataBrowserHelpDlg(shell);
help.open();
} else {
help.bringToTop();
try {
HelpManager.getInstance().displayHelpDialog(getShell(),
DATA_BROWSER_HELP_FILE);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"Error loading Help Text file: " + DATA_BROWSER_HELP_FILE,
e);
}
}
/**

View file

@ -1,89 +0,0 @@
package com.raytheon.uf.viz.datadelivery.browser;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.datadelivery.help.DataDeliveryHelp;
/**
* Help dialog for the Data Discover Browser.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 21, 2012 645 jpiatt Initial creation.
*
* </pre>
*
* @author jpiatt
* @version 1.0
*/
public class DataBrowserHelpDlg extends DataDeliveryHelp {
/**
* Constructor.
* @param parentShell
* Parent shell.
*/
public DataBrowserHelpDlg(Shell parentShell) {
this.parentShell = parentShell;
this.helpText = getHelpText();
}
/**
* Get the Help Text.
*
* @return String
* Help Text.
*/
private String getHelpText() {
String helpText = "<HTML><HEAD><TITLE>Dataset Discovery Browser Help</TITLE></HEAD><BODY>" +
"The Dataset Discovery Browser allows a user to find Datasets using " +
"filtering options.<br>First, select an Area for the Areal Coverage. Optionally, use" +
"the Set Area to select an Area. Next, select an available Data Type. Move the data type to " +
"the selected column using the arrows. Next, select from the filtering options. Filters " +
"include Data Provider, Data Set, Level or Parameter. Click the arrows to the left of the " +
"Filter titles to expand the filter selection sections. After Filters are selected, click " +
"<b>Update Results</b> to load the list of Datasets in the table. Select a Dataset and click the " +
"<b>Subset...</b> button. Optionally, select Subset information. Enter a Subset Name. Click " +
"the <b>Subscribe</b> button to subscribe to the subset. Click the <b>Query</b> button " +
"to find details about the subset." +
"<dl>" +
" <dt>" +
" <br><u><b>File</b></u><br>" +
" <dd><b>New Configuration</b><br>" +
" Clear the current configuration settings.<br>" +
" <b>Load Configuration...</b><br>" +
" Load a previously saved configuration file. Select from the Available " +
" Configuration Files list and click the <b>Load</b> button to load a configuration " +
" file. Use the <b>Preview</b> button to view the XML associated with the " +
" configuration file.<br>" +
" <b>Save Configuration</b><br>" +
" Save the current configuration settings to the most recently " +
" saved file name. The first time Save Configuration is accessed, " +
" select to save either at the User or Site level and enter a file name. " +
" Click the <b>Save</b> button to save the file. Use the Load Configuration " +
" menu item to load a saved configuration.<br>" +
" <b>Save Configuration As...</b><br>" +
" Save the current configuration settings to a named file " +
" that may be loaded in the future. In the Save Configuration dialog " +
" select to save either at the User or Site level and enter a file name. " +
" Click the <b>Save</b> button to save the file. Use the Load Configuration " +
" menu item to load a saved configuration.<br>" +
" <b>Delete Configuration...</b><br>" +
" Delete a saved configuration file.<br>" +
" <b>Exit</b><br>" +
" Exit the table.<br><br>" +
"</dl>" +
"</BODY></HTML>";
return helpText;
}
}

View file

@ -1,103 +0,0 @@
package com.raytheon.uf.viz.datadelivery.help;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* Find dialog for the Notification Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 18, 2012 645 jpiatt Initial creation.
*
* </pre>
*
* @author jpiatt
* @version 1.0
*/
public abstract class DataDeliveryHelp {
/** Parent shell */
protected Shell parentShell;
/** Browser object */
protected Browser browser;
/** Help Text */
protected String helpText;
/** Parent shell. */
Shell shell;
/**
* Open the browser to display the help text.
*/
public void open() {
Display display = parentShell.getDisplay();
shell = new Shell(display);
shell.setLayout(new FillLayout());
Browser browser;
try {
browser = new Browser(shell, SWT.NONE);
} catch (SWTError e) {
System.out.println("Could not instantiate Browser: " + e.getMessage());
display.dispose();
return;
}
browser.setText(helpText);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
close();
shell.dispose();
}
/**
* Set isDisposed boolean.
*
* @return boolean
*/
public boolean isDisposed() {
return (shell != null && shell.isDisposed());
}
/**
* Bring the dialog to top.
*/
public final void bringToTop() {
if (shell != null && shell.isDisposed() == false) {
shell.setVisible(true);
shell.forceFocus();
shell.forceActive();
}
}
/**
* Closes the shell.
* @return
* boolean
*
*/
public final boolean close() {
if (shell != null && shell.isDisposed() == false) {
shell.dispose();
}
return true;
}
}

View file

@ -0,0 +1,151 @@
package com.raytheon.uf.viz.datadelivery.help;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
/**
* Help dialog for Data Delivery.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 06/06/2013 2030 mpduff Initial creation.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class DataDeliveryHelpDlg extends CaveSWTDialog {
/** Styled Text control */
private StyledText styledText;
/** List of StyleRange objects */
private final List<StyleRange> ranges = new ArrayList<StyleRange>();
/** Pattern for 1 or more spaces */
private static final Pattern pattern = Pattern.compile(" +");
/** Help JaxB xml object */
private final DataDeliveryHelpXML helpXml;
/**
* Constructor.
*
* @param parentShell
* Parent shell.
* @param helpXml
* The JaxB xml object
*/
public DataDeliveryHelpDlg(Shell parentShell, DataDeliveryHelpXML helpXml) {
super(parentShell, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE,
CAVE.DO_NOT_BLOCK | CAVE.NO_PACK);
this.helpXml = helpXml;
}
/*
* (non-Javadoc)
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
*/
@Override
protected Layout constructShellLayout() {
return new GridLayout(1, false);
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayoutData()
*/
@Override
protected Object constructShellLayoutData() {
return new GridData(SWT.FILL, SWT.DEFAULT, true, false);
}
/**
* {@inheritDoc}
*/
@Override
protected void initializeComponents(Shell shell) {
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
GridLayout gl = new GridLayout(1, false);
shell.setLayout(gl);
shell.setLayoutData(gd);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gl = new GridLayout(1, false);
styledText = new StyledText(shell, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
styledText.setLayout(gl);
styledText.setLayoutData(gd);
String text = getHelpText();
styledText.setText(text);
styledText.setLineAlignment(0, 1, SWT.CENTER);
for (StyleRange sr : ranges) {
styledText.setStyleRange(sr);
}
}
/**
* {@inheritDoc}
*/
@Override
protected void opened() {
shell.setMinimumSize(400, 600);
}
/**
* Get the help text from the xml.
*
* @return The help text String
*/
private String getHelpText() {
StringBuilder buffer = new StringBuilder();
this.setText(helpXml.getTitle());
// indices for style ranges start and end
int startIdx = 0;
for (HelpEntryXML entry : helpXml.getEntryList()) {
startIdx = buffer.length();
buffer.append(entry.getHeader().trim()).append(StringUtil.NEWLINE);
StyleRange sr = new StyleRange();
sr.start = startIdx;
sr.length = buffer.length() - startIdx;
sr.fontStyle = SWT.BOLD;
ranges.add(sr);
Matcher matcher = pattern.matcher(entry.getText().trim());
String text = matcher.replaceAll(" ");
if (text.length() > 0) {
buffer.append(text).append(StringUtil.NEWLINE)
.append(StringUtil.NEWLINE);
} else {
buffer.append(StringUtil.NEWLINE);
}
}
return buffer.toString();
}
}

View file

@ -0,0 +1,93 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.datadelivery.help;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlRootElement;
/**
* JaxB xml object for Data Delivery Help.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 4, 2013 2030 mpduff Initial creation.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlRootElement(name = "Help")
@XmlAccessorType(XmlAccessType.NONE)
public class DataDeliveryHelpXML {
/**
* The help title.
*/
@XmlElement
private String title;
/**
* The help topic entries.
*/
@XmlElements({ @XmlElement(name = "helpEntry", type = HelpEntryXML.class) })
protected List<HelpEntryXML> entryList = new ArrayList<HelpEntryXML>();
/**
* @return the title
*/
public String getTitle() {
return title;
}
/**
* @param title
* the title to set
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the entryList
*/
public List<HelpEntryXML> getEntryList() {
return entryList;
}
/**
* @param entryList
* the entryList to set
*/
public void setEntryist(List<HelpEntryXML> entryList) {
this.entryList = entryList;
}
}

View file

@ -0,0 +1,89 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.datadelivery.help;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* HelpEntry JaxB object.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 4, 2013 2030 mpduff Initial creation.
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
@XmlRootElement(name = "HelpEntry")
@XmlAccessorType(XmlAccessType.NONE)
public class HelpEntryXML {
/**
* Help entry header.
*/
@XmlElement
private String header;
/**
* Help entry text.
*/
@XmlElement
private String text;
/**
* @return the header
*/
public String getHeader() {
return header;
}
/**
* @param header
* the header to set
*/
public void setHeader(String header) {
this.header = header;
}
/**
* @return the text
*/
public String getText() {
return text;
}
/**
* @param text
* the text to set
*/
public void setText(String text) {
this.text = text;
}
}

View file

@ -0,0 +1,146 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.viz.datadelivery.help;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationFile;
import com.raytheon.uf.common.localization.PathManagerFactory;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.viz.ui.dialogs.ICloseCallback;
/**
* Data Delivery Help Dialog manager class.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 4, 2013 mpduff Initial creation
*
* </pre>
*
* @author mpduff
* @version 1.0
*/
public class HelpManager {
/** Status Handler */
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(HelpManager.class);
/** Class instance */
private static HelpManager instance = null;
/** JAXB context */
private JAXBContext jax;
/** Unmarshaller object */
private Unmarshaller unmarshaller;
/** Help dialog map for managing open help dialogs */
private final Map<String, DataDeliveryHelpDlg> helpMap = new HashMap<String, DataDeliveryHelpDlg>();
/**
* Private constructor.
*
* @throws JAXBException
*/
private HelpManager() throws JAXBException {
createContext();
}
/**
* Get the only instance of this class.
*
* @return The instance
* @throws Exception
*/
public static final synchronized HelpManager getInstance() throws Exception {
if (instance == null) {
instance = new HelpManager();
}
return instance;
}
/**
* Create the JAXB context
*
* @throws JAXBException
*/
private void createContext() throws JAXBException {
Class[] classes = new Class[] { DataDeliveryHelpXML.class,
HelpEntryXML.class };
jax = JAXBContext.newInstance(classes);
this.unmarshaller = jax.createUnmarshaller();
}
/**
* Display a help dialog.
*
* @param shell
* The parent shell
* @param helpFile
* The file containing the text
*/
public void displayHelpDialog(Shell shell, final String helpFile) {
if (helpMap.containsKey(helpFile)) {
helpMap.get(helpFile).bringToTop();
return;
}
IPathManager pm = PathManagerFactory.getPathManager();
LocalizationFile locFile = pm.getStaticLocalizationFile(helpFile);
DataDeliveryHelpXML xml = new DataDeliveryHelpXML();
if (locFile != null && locFile.exists()) {
try {
xml = (DataDeliveryHelpXML) unmarshaller.unmarshal(locFile
.getFile());
DataDeliveryHelpDlg helpDlg = new DataDeliveryHelpDlg(shell, xml);
helpDlg.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
helpMap.remove(helpFile);
}
});
helpMap.put(helpFile, helpDlg);
helpDlg.open();
} catch (JAXBException e) {
statusHandler.handle(Priority.ERROR,
"Error displaying help dialog for file " + helpFile, e);
}
}
}
}

View file

@ -65,6 +65,7 @@ import com.raytheon.uf.viz.datadelivery.common.ui.ITableChange;
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg;
import com.raytheon.uf.viz.datadelivery.common.ui.LoadSaveConfigDlg.DialogType;
import com.raytheon.uf.viz.datadelivery.common.ui.TableCompConfig;
import com.raytheon.uf.viz.datadelivery.help.HelpManager;
import com.raytheon.uf.viz.datadelivery.notification.PriorityImages.Priority;
import com.raytheon.uf.viz.datadelivery.notification.xml.MessageLoadXML;
import com.raytheon.uf.viz.datadelivery.notification.xml.NotificationConfigXML;
@ -97,6 +98,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
* Update title bar text when paused.
* Jan 22, 2013 1520 mpduff Change delete menus to hide.
* Apr 25, 2013 1820 mpduff Implemente delete config.
* Jun 06, 2013 2030 mpduff Refactored help.
*
* </pre>
*
@ -108,7 +110,7 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
IMessageLoad, INotificationArrivedListener {
/** Status Handler */
private final transient IUFStatusHandler statusHandler = UFStatus
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(NotificationDlg.class);
private final String TITLE_TEXT = "Notification Center";
@ -116,12 +118,12 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
/** Find Dialog */
private FindDlg fnd = null;
/** Help Dialog */
private final NotificationHelpDlg help = null;
/** Message load properties */
private MessageLoadXML messageLoad;
/** Help text file */
private final String NOTIFICATION_HELP_FILE = "help/notificationHelp.xml";
/** Path of the Notification Config xml file */
private final String CONFIG_PATH = "dataDelivery" + File.separator
+ "notificationManagerConfig";
@ -490,15 +492,13 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
* Handle the help display dialog.
*/
private void handleHelp() {
if (help == null || help.isDisposed()) {
NotificationHelpDlg help = new NotificationHelpDlg(shell);
help.open();
help = null;
} else {
help.bringToTop();
try {
HelpManager.getInstance().displayHelpDialog(shell,
NOTIFICATION_HELP_FILE);
} catch (Exception e) {
statusHandler.error("Error loading Help Text file: "
+ NOTIFICATION_HELP_FILE, e);
}
}
/**

View file

@ -1,146 +0,0 @@
package com.raytheon.uf.viz.datadelivery.notification;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.datadelivery.help.DataDeliveryHelp;
/**
* Help dialog for the Notification Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 18, 2012 645 jpiatt Initial creation.
*
* </pre>
*
* @author jpiatt
* @version 1.0
*/
public class NotificationHelpDlg extends DataDeliveryHelp {
/**
* Constructor.
* @param parentShell
* Parent shell.
*/
public NotificationHelpDlg(Shell parentShell) {
this.parentShell = parentShell;
this.helpText = getHelpText();
}
/**
* Get the Help Text.
*
* @return String
* Help Text.
*/
private String getHelpText() {
String helpText = "<HTML><HEAD><TITLE>Notification Table Help</TITLE></HEAD><BODY>" +
"The Notification Center Table allows a user to view and delete " +
"data delivery notifications.<br><br>" +
// "<a href='#file'><u><b>File</b></u><br></a>" +
// "<a href='#edit'><u><b>Edit</b></u><br></a>" +
// "<a href='#settings'><u><b>Settings</b></u><br></a><br>" +
"<dl>" +
" <dt>" +
" <a name='file'><u><b>File</b></u><br>"+
" <dd>" +
" <b>Set As Default</b><br>" +
" Set the current configuration settings to be the default " +
" settings for the table. When the table is opened the " +
" saved default settings are applied.<br>" +
" <b>Load Configuration...</b><br>" +
" Load a previously saved configuration file. Select from the Available " +
" Configuration Files list and click the <b>Load</b> button to load a configuration " +
" file. Use the <b>Preview</b> button to view the XML associated with the " +
" configuration file.<br>" +
" <b>Save Configuration</b><br>" +
" Save the current configuration settings to the most recently " +
" saved file name. The first time Save Configuration is accessed, " +
" select to save either at the User or Site level and enter a file name. " +
" Click the <b>Save</b> button to save the file. Use the Load Configuration " +
" menu item to load a saved configuration.<br>" +
" <b>Save Configuration As...</b><br>" +
" Save the current configuration settings to a named file " +
" that may be loaded in the future. In the Save Configuration dialog " +
" select to save either at the User or Site level and enter a file name. " +
" Click the <b>Save</b> button to save the file. Use the Load Configuration " +
" menu item to load a saved configuration.<br>" +
" <b>Delete Configuration...</b><br>" +
" Delete a saved configuration file.<br>" +
" <b>Exit</b><br>" +
" Exit the table.<br><br>" +
" <dt>" +
" <a name='edit'><u><b>Edit</u></b><br>" +
" <dd>" +
" <b>Find...</b><br>" +
" Find and highlight items in the table using the Find dialog. The " +
" Case Sensitive option allows a user to search text that is capitalization " +
" sensitive. The Exclude option allows a user to search the table for " +
" items that exclude the entered text. The Case Sensitive and Exclude options " +
" may be used in conjunction with another. The Column Selection grouping allows " +
" users to search a specific column in the table. After the search criteria " +
" has been selected, click the <b>Find Next</b> button to perform the search. The " +
" <b>Hightlight All</b> button highlights all the rows matching the find " +
" criteria. Close the Find dialog using the <b>Close</b> button.<br>" +
" <b>Delete by Priority</b><br>" +
" Delete all rows in the table having a specific priority. (Note: Notifications " +
" only deleted from the user view and not permanently deleted from the database.)<br>" +
" <b>Delete Older Than Selected </b><br>" +
" Delete all rows in the table having a date in the Time column that is older " +
" than the currently highlighted row. (Note: Notifications <br>" +
" only deleted from the user view and not permanently deleted from the database.)<br>" +
" <b>Delete Notification(s)</b><br>" +
" Delete the currently highlighted row(s) in the table. (Note: Notifications " +
" only deleted from the user view and not permanently deleted from the database.)<br><br>" +
" <dt>" +
" <a name='settings'><u><b>Settings</u></b><br>" +
" <dd>" +
" <b>Configure Table...</b><br>" +
" The Initial Startup Configuration items are set when the table is opened. " +
" Check the <b>Load All Messages</b> check box to display all messages in the table that " +
" are contained in the database. Enter a number of messages or hours amount in the " +
" <b>Load Last</b> spinner to select the amount of messages or number of hours of messages " +
" to display in the table. Set the <b>Initial Sort Column</b> and either <b>Sort Ascending</b> " +
" or <b>Sort Descending</b> to sort the table by a specific colum upon opening. " +
" <br>The Display Configuration items refresh the table upon clicking <b>OK</b>. Select the " +
" number of <b>Rows Per Page</b> using the selection drop down. Select the image setting " +
" for the Priority table column using the radio buttons. Select to make columns " +
" hidden or visible using the arrows provided. After making selections, click the <b>OK</b>" +
" button to configure the table. (Note: Unless the configuration is set to the default " +
" or saved, changes will be lost when the table is closed.)<br>" +
" <b>Filter Table...</b><br>" +
" A user may filter the table by user, by subscription or by priority.<br>In the Filter by " +
" User section, the list of available user names are in the Available Users column. If users are moved " +
" to the Selected Users list, the corresponding columns containing those user names will be " +
" displayed in the Notification Table. Use the arrows to move users back and forth from the " +
" Available Users list to the Selected Users list. (Note: User names are not duplicated and " +
" appear only once either in the Available or Selected lists.) The Always include my notifications " +
" check box may be used to keep the currently logged in user in the Selected Users column. " +
" <br>In the Filter by Subscription section, the list of available subscription names are in the " +
" Available Subscriptions column. If subscriptions are moved to the Selected Subscriptions list " +
" the corresponding columns containing those subscription names will be displayed in the " +
" Notification Table. Use the arrows to move subscriptions back and forth from the " +
" Available Subscriptions list to the Selected Subscriptions list. (Note: Subscription " +
" names are not duplicated and appear only once either in the Available or Selected lists.)" +
" <br>In the Filter by Priority section, select which columns containing specific priorities to " +
" display using the checkboxes." +
"</dl>" +
"</BODY></HTML>";
return helpText;
}
}

View file

@ -1,137 +0,0 @@
package com.raytheon.uf.viz.datadelivery.subscription;
import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.viz.datadelivery.help.DataDeliveryHelp;
/**
* Help dialog for the Subscription Table.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* May 18, 2012 645 jpiatt Initial creation.
*
* </pre>
*
* @author jpiatt
* @version 1.0
*/
public class SubscriptionHelpDlg extends DataDeliveryHelp {
/**
* Constructor.
* @param parentShell
* Parent shell.
*/
public SubscriptionHelpDlg(Shell parentShell) {
this.parentShell = parentShell;
this.helpText = getHelpText();
}
/**
* Get the Help Text.
*
* @return String
* Help Text.
*/
private String getHelpText() {
String helpText = "<HTML><HEAD><TITLE>Subscription Table Help</TITLE></HEAD><BODY>" +
"The Subscription Manager Table allows a user to add, edit, copy, view, and delete " +
"data delivery subscriptions.<br><br>" +
// "<a href='#file'><u><b>File</b></u><br></a>" +
// "<a href='#edit'><u><b>Edit</b></u><br></a>" +
// "<a href='#settings'><u><b>Settings</b></u><br></a><br>" +
"<dl>" +
" <dt>" +
" <a name='file'><u><b>File</b></u><br>"+
" <dd>" +
" <b>New Subscription</b><br>" +
" The New Subscription menu option opens the Dataset Discovery Browser. " +
" The Dataset Discovery Browser allows a user to find Datasets using " +
" filtering options.<br>First, select an Area for the Areal Coverage. Optionally, use" +
" the Set Area to select an Area. Next, select an available Data Type. Move the data type to " +
" the selected column using the arrows. Next, select from the filtering options. Filters " +
" include Data Provider, Data Set, Level or Parameter. Click the arrows to the left of the " +
" Filter titles to expand the filter selection sections. After Filters are selected, click " +
" <b>Update Results</b> to load the list of Datasets in the table. Select a Dataset row(s) and click the " +
" <b>Subset...</b> button. Optionally, select Subset information. Enter a Subset Name. Click " +
" the <b>Subscribe</b> button to subscribe to the subset. Click the <b>Query</b> button " +
" to perform an adhoc retrieval using the currently selected subset parameters.<br>" +
" <b>Set As Default</b><br>" +
" Set the current configuration settings to be the default " +
" settings for the table. When the table is opened the " +
" saved default settings are applied.<br>" +
" <b>Load Configuration...</b><br>" +
" Load a previously saved configuration file. Select from the Available " +
" Configuration Files list and click the <b>Load</b> button to load a configuration " +
" file. Use the <b>Preview</b> button to view the XML associated with the " +
" configuration file.<br>" +
" <b>Save Configuration</b><br>" +
" Save the current configuration settings to the most recently " +
" saved file name. The first time Save Configuration is accessed, " +
" select to save either at the User or Site level and enter a file name. " +
" Click the <b>Save</b> button to save the file. Use the Load Configuration " +
" menu item to load a saved configuration.<br>" +
" <b>Save Configuration As...</b><br>" +
" Save the current configuration settings to a named file " +
" that may be loaded in the future. In the Save Configuration dialog " +
" select to save either at the User or Site level and enter a file name. " +
" Click the <b>Save</b> button to save the file. Use the Load Configuration " +
" menu item to load a saved configuration.<br>" +
" <b>Refresh Table</b><br>" +
" Refresh the table data.<br>" +
" <b>Exit</b><br>" +
" Exit the table.<br><br>" +
" <dt>" +
" <a name='edit'><u><b>Edit</u></b><br>" +
" <dd>" +
" <b>Edit Subscription...</b><br>" +
" Highlight a row in the table to edit. Modify the Subscription Delivery Options, " +
" the Subscription Duration, the Subscription Active Period, the Subscription " +
" Priority or the additional Subscription Information. <br>Subscription Duration sets " +
" the start and expiration times for subscription delivery. Use the No Expiration " +
" radio button to continue to receive the subscription. <br>The Subscription Active " +
" Period may be used to select a specified time range for the subscription to be " +
" active. (Note: The active period does not include the year.) The Subscription " +
" Priority sets the order of subscription fullfillment and may be set to High (1), " +
" Default (2), or Low (3).<br>The Subscription Information allows the Description " +
" to be modified. The Subscription Name may not be modified.<br> Click <b>OK</b> " +
" to perform the edit.<br>" +
" <b>Copy Subscription...</b><br>" +
" Highlight a row in the table to copy. Enter a New Subscription Name. Click " +
" <b>OK</b> to perform the copy.<br>" +
" <b>Delete Subscription...</b><br>" +
" Highlight a row(s) in the table to delete. Click <b>Yes</b> to perform the " +
" deletion.<br><br>" +
" <dt>" +
" <a name='settings'><u><b>Settings</u></b><br>" +
" <dd>" +
" <b>Configure Table...</b><br>" +
" The Table Column Configuration Settings allow a user to hide and make visible table " +
" columns. The list of Hidden Columns is located on the left and the Visible Columns list is " +
" located on the right. If columns are moved to the Visible Columns list, the corresponding " +
" columns will be displayed in the Notification Table. Use the right and left arrows to " +
" move column names back and forth from the Hidden Columns list to the Visible Columns list. " +
" Use the up and down arrows to change the order of the visible columns as seen in the table. " +
" (Note: Column names are not duplicated and appear only once either in the Hidden or Visible " +
" lists.) After making selections, click the <b>OK</b> button to configure the table. (Note: " +
" Unless the configuration is set to the default or saved, changes will be lost when the " +
" table is closed.)<br>" +
"</dl>" +
"</BODY></HTML>";
return helpText;
}
}

View file

@ -68,6 +68,7 @@ import com.raytheon.uf.viz.datadelivery.actions.DataBrowserAction;
import com.raytheon.uf.viz.datadelivery.common.ui.IGroupAction;
import com.raytheon.uf.viz.datadelivery.common.ui.ITableChange;
import com.raytheon.uf.viz.datadelivery.common.ui.TableCompConfig;
import com.raytheon.uf.viz.datadelivery.help.HelpManager;
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.IForceApplyPromptDisplayText;
@ -122,6 +123,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
* May 09, 2013 2000 djohnson Copy subscription now requires editing first to prevent duplicates, and remove duplicate code.
* May 17, 2013 1040 mpduff Change office id to list for shared subscription.
* May 28, 2013 1650 djohnson Allow specifying filters for what subscriptions to show.
* Jun 06, 2013 2030 mpduff Refactored help.
* </pre>
*
* @author mpduff
@ -135,6 +137,9 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(SubscriptionManagerDlg.class);
/** Help file */
private final String SUBSCRIPTION_MANAGER_HELP_FILE = "help/subscriptionManagerHelp.xml";
/** Enumeration to use with Data set */
public static enum FullDataset {
/** Full data set of type Full */
@ -167,9 +172,6 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
/** Subscription Manager Configuration Dialog */
private SubscriptionManagerConfigDlg configDlg = null;
/** Help Dialog */
private final SubscriptionHelpDlg help = null;
/** Subscription table composite. */
private SubscriptionTableComp tableComp;
@ -779,12 +781,12 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
final String office = officeCbo.getText();
tableComp.setSubscriptionFilter(new ISubscriptionManagerFilter() {
@Override
public List<Subscription> getSubscriptions(
ISubscriptionHandler subscriptionHandler)
throws RegistryHandlerException {
final List<Subscription> results = filter.getSubscriptions(subscriptionHandler);
final List<Subscription> results = filter
.getSubscriptions(subscriptionHandler);
// Remove any that don't match the configured filters. TODO:
// This should be cleaned up at some point in the future
@ -794,8 +796,8 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
if ((office == null || "ALL".equals(office) || subscription
.getOfficeIDs().contains(office))
&& (group == null
|| "All Subscriptions".equals(group)
|| group.equals(subscription.getGroupName()))) {
|| "All Subscriptions".equals(group) || group
.equals(subscription.getGroupName()))) {
continue;
}
iter.remove();
@ -905,12 +907,13 @@ public class SubscriptionManagerDlg extends CaveSWTDialog implements
* Handle the help display dialog.
*/
private void handleHelp() {
if (help == null || help.isDisposed()) {
SubscriptionHelpDlg help = new SubscriptionHelpDlg(shell);
help.open();
} else {
help.bringToTop();
try {
HelpManager.getInstance().displayHelpDialog(getShell(),
SUBSCRIPTION_MANAGER_HELP_FILE);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"Error loading Help Text file: "
+ SUBSCRIPTION_MANAGER_HELP_FILE, e);
}
}

View file

@ -54,6 +54,7 @@ import com.raytheon.uf.viz.core.notification.NotificationException;
import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.datadelivery.common.ui.TableCompConfig;
import com.raytheon.uf.viz.datadelivery.common.ui.TableDataManager;
import com.raytheon.uf.viz.datadelivery.help.HelpManager;
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService;
@ -90,6 +91,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
* Dec 12, 2012 1433 bgonzale Use new subscription copy ctor method for approval of pending subscription.
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
* Jun 06, 2013 2030 mpduff Refactored help.
*
* </pre>
*
@ -128,6 +130,9 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
}
}
/** Help file */
protected final String HELP_FILE = "help/subscriptionApprovalHelp.xml";
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(SubscriptionApprovalDlg.class);
@ -144,21 +149,21 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
private String denyMessage;
/**
* Constructor.
*
*
* @param parent
* The parent Shell
*/
public SubscriptionApprovalDlg(Shell parent) {
super(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE, CAVE.INDEPENDENT_SHELL);
super(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.RESIZE,
CAVE.INDEPENDENT_SHELL | CAVE.DO_NOT_BLOCK);
setText("Subscription Approval");
}
/*
* (non-Javadoc)
*
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayoutData()
*/
@ -169,7 +174,7 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
/*
* (non-Javadoc)
*
*
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
*/
@Override
@ -184,7 +189,7 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
/*
* (non-Javadoc)
*
*
* @see
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
* .eclipse.swt.widgets.Shell)
@ -273,7 +278,13 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
aboutMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
HelpManager.getInstance().displayHelpDialog(getShell(),
HELP_FILE);
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"Error loading Help Text file: " + HELP_FILE, e);
}
}
});
@ -281,8 +292,10 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
}
private void createTable() {
TableCompConfig tableConfig = new TableCompConfig(TABLE_TYPE.PENDING_SUBSCRIPTION);
tableConfig.setTableStyle(SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);
TableCompConfig tableConfig = new TableCompConfig(
TABLE_TYPE.PENDING_SUBSCRIPTION);
tableConfig.setTableStyle(SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
| SWT.MULTI | SWT.FULL_SELECTION);
tableConfig.setTableHeight(200);
tableComp = new SubApprovalTableComp(shell, tableConfig, this);
}
@ -323,8 +336,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
@Override
public void handleApprove() {
if (tableComp.getTable().getSelectionCount() == 0) {
DataDeliveryUtils
.showMessage(shell, SWT.ERROR, "No Rows Selected", "Please select a row or rows to Approve");
DataDeliveryUtils.showMessage(shell, SWT.ERROR, "No Rows Selected",
"Please select a row or rows to Approve");
return;
}
getShell().setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
@ -334,7 +347,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
IAuthorizedPermissionResponse response = allowed(user);
if (response.isAuthorized()) {
// Check if user or site permissions, compare to owner of sub if user permission
// Check if user or site permissions, compare to owner of sub if
// user permission
boolean site = false;
if (response
@ -342,11 +356,13 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
site = true;
}
TableDataManager<SubscriptionApprovalRowData> pendingSubData = tableComp.getPendingSubData();
TableDataManager<SubscriptionApprovalRowData> pendingSubData = tableComp
.getPendingSubData();
ArrayList<SubscriptionApprovalRowData> approveList = new ArrayList<SubscriptionApprovalRowData>();
ArrayList<String> notApprovedSubList = new ArrayList<String>();
for (int idx : tableComp.getTable().getSelectionIndices()) {
SubscriptionApprovalRowData approvedItem = pendingSubData.getDataRow(idx);
SubscriptionApprovalRowData approvedItem = pendingSubData
.getDataRow(idx);
if (site) {
approveList.add(approvedItem);
} else {
@ -363,9 +379,11 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
}
if (notApprovedSubList.size() > 0) {
StringBuilder buffer = new StringBuilder(user.uniqueId().toString() + " is not authorized to approve pending subscriptions belonging to other users. " +
"\nNot authorized to approve the following subscriptions:\n\n");
for (String name: notApprovedSubList) {
StringBuilder buffer = new StringBuilder(
user.uniqueId().toString()
+ " is not authorized to approve pending subscriptions belonging to other users. "
+ "\nNot authorized to approve the following subscriptions:\n\n");
for (String name : notApprovedSubList) {
buffer.append(name).append("\n");
}
@ -408,7 +426,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
public void handleDeny() {
if (tableComp.getTable().getSelectionCount() == 0) {
DataDeliveryUtils
.showMessage(getShell(), SWT.ERROR, "No Rows Selected", "Please select a row or rows to delete");
.showMessage(getShell(), SWT.ERROR, "No Rows Selected",
"Please select a row or rows to delete");
return;
}
getShell().setCursor(getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
@ -417,7 +436,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
IAuthorizedPermissionResponse response = allowed(user);
if (response.isAuthorized()) {
if (confirm()) {
// Check if user or site permissions, compare to owner of sub if user permission
// Check if user or site permissions, compare to owner of sub if
// user permission
boolean site = false;
if (response
@ -425,11 +445,13 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
site = true;
}
TableDataManager<SubscriptionApprovalRowData> pendingSubData = tableComp.getPendingSubData();
TableDataManager<SubscriptionApprovalRowData> pendingSubData = tableComp
.getPendingSubData();
ArrayList<SubscriptionApprovalRowData> deleteList = new ArrayList<SubscriptionApprovalRowData>();
final String username = user.uniqueId().toString();
for (int idx : tableComp.getTable().getSelectionIndices()) {
SubscriptionApprovalRowData removedItem = pendingSubData.getDataRow(idx);
SubscriptionApprovalRowData removedItem = pendingSubData
.getDataRow(idx);
if (site) {
deleteList.add(removedItem);
@ -465,7 +487,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
tableComp.repopulate();
} else {
String msg = username + " is not authorized to deny pending subscriptions belonging to other users.";
String msg = username
+ " is not authorized to deny pending subscriptions belonging to other users.";
statusHandler.handle(Priority.WARN, msg);
}
}
@ -486,11 +509,10 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
return false;
}
private void approveSubs(ArrayList<SubscriptionApprovalRowData> subList) {
tableComp.getPendingSubData().removeAll(subList);
String username = System.getenv().get("LOGNAME");
for (SubscriptionApprovalRowData rd: subList) {
for (SubscriptionApprovalRowData rd : subList) {
InitialPendingSubscription ps = rd.getSubscription();
Subscription s = ps.subscription();
@ -527,7 +549,7 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
/*
* (non-Javadoc)
*
*
* @see com.raytheon.uf.viz.core.notification.INotificationObserver#
* notificationArrived
* (com.raytheon.uf.viz.core.notification.NotificationMessage[])
@ -565,7 +587,6 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
*/
@Override
public boolean displayYesNoPopup(String title, String message) {
return DataDeliveryUtils.showYesNoMessage(getShell(), title,
message) == SWT.YES;
return DataDeliveryUtils.showYesNoMessage(getShell(), title, message) == SWT.YES;
}
}