You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/11/13 16:13:18 UTC
svn commit: r1769512 [11/15] - in /uima/uimaj/branches/experiment-v3-jcas:
uimaj-ep-cas-editor-ide/src/main/java/org/apache/uima/caseditor/ide/
uimaj-ep-cas-editor/src/main/java/org/apache/uima/caseditor/
uimaj-ep-cas-editor/src/main/java/org/apache/ui...
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialog.java Sun Nov 13 16:13:16 2016
@@ -50,8 +50,13 @@ import org.eclipse.swt.widgets.TableItem
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AbstractDialog.
+ */
public abstract class AbstractDialog extends Dialog implements Listener, StandardStrings {
+ /** The Constant contentAssistAvailable. */
private final static boolean contentAssistAvailable;
static {
boolean contentAssistIsOK = false;
@@ -63,22 +68,30 @@ public abstract class AbstractDialog ext
contentAssistAvailable = contentAssistIsOK;
}
+ /** The editor. */
protected MultiPageEditor editor;
+ /** The section. */
protected AbstractSection section;
+ /** The ok button. */
protected Button okButton;
+ /** The error message UI. */
protected Label errorMessageUI;
+ /** The title. */
protected String title;
+ /** The dialog description. */
protected String dialogDescription;
/**
- * @param section
- * @param title
- * @param description
+ * Instantiates a new abstract dialog.
+ *
+ * @param section the section
+ * @param title the title
+ * @param description the description
*/
protected AbstractDialog(AbstractSection section, String title, String description) {
// maintainers: don't use new shell; see comment in Dialog class
@@ -86,11 +99,25 @@ public abstract class AbstractDialog ext
commonInit(section, title, description);
}
+ /**
+ * Instantiates a new abstract dialog.
+ *
+ * @param shell the shell
+ * @param title the title
+ * @param description the description
+ */
protected AbstractDialog(Shell shell, String title, String description) {
super(shell);
commonInit(null, title, description);
}
+ /**
+ * Common init.
+ *
+ * @param aSection the a section
+ * @param aTitle the a title
+ * @param aDescription the a description
+ */
private void commonInit(AbstractSection aSection, String aTitle, String aDescription) {
section = aSection;
editor = (null == section)? null : section.editor;
@@ -99,13 +126,28 @@ public abstract class AbstractDialog ext
dialogDescription = aDescription;
}
+ /**
+ * Sets the title.
+ *
+ * @param title the new title
+ */
public void setTitle(String title) {
this.title = title;
}
+ /**
+ * Sets the message.
+ *
+ * @param msg the new message
+ */
public void setMessage(String msg) {
this.dialogDescription = msg;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
// create composite
Composite composite = (Composite) super.createDialogArea(parent);
@@ -113,6 +155,13 @@ public abstract class AbstractDialog ext
return composite;
}
+ /**
+ * Creates the dialog area.
+ *
+ * @param parent the parent
+ * @param existing the existing
+ * @return the control
+ */
protected Control createDialogArea(Composite parent, Object existing) {
Composite composite = (Composite) super.createDialogArea(parent);
createWideLabel(composite, dialogDescription);
@@ -121,11 +170,22 @@ public abstract class AbstractDialog ext
return composite;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+ */
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(title);
}
+ /**
+ * Creates the wide label.
+ *
+ * @param parent the parent
+ * @param message the message
+ * @return the label
+ */
protected Label createWideLabel(Composite parent, String message) {
Label label = null;
@@ -137,34 +197,75 @@ public abstract class AbstractDialog ext
return label;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
okButton = getButton(IDialogConstants.OK_ID);
okButton.setEnabled(false);
}
+ /** The Constant stringArray0. */
public static final String[] stringArray0 = new String[0];
+ /**
+ * Sets the text and tip.
+ *
+ * @param c the c
+ * @param label the label
+ * @param tip the tip
+ */
protected void setTextAndTip(Button c, String label, String tip) {
c.setText(label);
c.setToolTipText(tip);
}
+ /**
+ * Sets the text and tip.
+ *
+ * @param c the c
+ * @param label the label
+ * @param tip the tip
+ */
protected void setTextAndTip(CCombo c, String label, String tip) {
c.setText(label);
c.setToolTipText(tip);
}
+ /**
+ * Sets the text and tip.
+ *
+ * @param c the c
+ * @param label the label
+ * @param tip the tip
+ */
protected void setTextAndTip(Label c, String label, String tip) {
c.setText(label);
c.setToolTipText(tip);
}
+ /**
+ * Sets the text and tip.
+ *
+ * @param c the c
+ * @param label the label
+ * @param tip the tip
+ * @param horizStyle the horiz style
+ * @param horizGrab the horiz grab
+ */
protected void setTextAndTip(Label c, String label, String tip, int horizStyle, boolean horizGrab) {
setTextAndTip(c, label, tip);
c.setLayoutData(new GridData(horizStyle, SWT.BEGINNING, horizGrab, false));
}
+ /**
+ * New 2 column composite.
+ *
+ * @param parent the parent
+ * @return the composite
+ */
protected Composite new2ColumnComposite(Composite parent) {
Composite twoCol = new Composite(parent, SWT.NONE);
twoCol.setLayout(new GridLayout(2, false)); // false = not equal width
@@ -174,6 +275,13 @@ public abstract class AbstractDialog ext
return twoCol;
}
+ /**
+ * New description.
+ *
+ * @param twoCol the two col
+ * @param tip the tip
+ * @return the text
+ */
protected Text newDescription(Composite twoCol, String tip) {
setTextAndTip(new Label(twoCol, SWT.NONE), S_DESCRIPTION, tip);
Text t = new Text(twoCol, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
@@ -183,11 +291,26 @@ public abstract class AbstractDialog ext
return t;
}
+ /**
+ * New labeled C combo.
+ *
+ * @param parent the parent
+ * @param label the label
+ * @param tip the tip
+ * @return the c combo
+ */
protected CCombo newLabeledCCombo(Composite parent, String label, String tip) {
setTextAndTip(new Label(parent, SWT.NONE), label, tip);
return newCCombo(parent, tip);
}
+ /**
+ * New C combo.
+ *
+ * @param parent the parent
+ * @param tip the tip
+ * @return the c combo
+ */
protected CCombo newCCombo(Composite parent, String tip) {
final CCombo cc = new CCombo(parent, SWT.FLAT | SWT.BORDER | SWT.READ_ONLY);
cc.setBackground(getShell().getDisplay().getSystemColor(SWT.COLOR_WHITE));
@@ -201,9 +324,11 @@ public abstract class AbstractDialog ext
cc.addKeyListener(new KeyListener() {
private final StringBuffer b = new StringBuffer();
+ @Override
public void keyPressed(KeyEvent e) {
}
+ @Override
public void keyReleased(KeyEvent e) {
if (e.keyCode == SWT.BS) {
if (b.length() > 0)
@@ -228,6 +353,15 @@ public abstract class AbstractDialog ext
return cc;
}
+ /**
+ * New button.
+ *
+ * @param parent the parent
+ * @param style the style
+ * @param name the name
+ * @param tip the tip
+ * @return the button
+ */
protected Button newButton(Composite parent, int style, String name, String tip) {
Button b = new Button(parent, style);
setTextAndTip(b, name, tip);
@@ -235,6 +369,14 @@ public abstract class AbstractDialog ext
return b;
}
+ /**
+ * New text.
+ *
+ * @param parent the parent
+ * @param style the style
+ * @param tip the tip
+ * @return the text
+ */
protected Text newText(Composite parent, int style, String tip) {
Text t = new Text(parent, style | SWT.BORDER);
t.setToolTipText(tip);
@@ -244,11 +386,27 @@ public abstract class AbstractDialog ext
return t;
}
+ /**
+ * New labeled text.
+ *
+ * @param parent the parent
+ * @param style the style
+ * @param label the label
+ * @param tip the tip
+ * @return the text
+ */
protected Text newLabeledText(Composite parent, int style, String label, String tip) {
setTextAndTip(new Label(parent, SWT.NONE), label, tip);
return newText(parent, style, tip);
}
+ /**
+ * New tree.
+ *
+ * @param parent the parent
+ * @param style the style
+ * @return the tree
+ */
protected Tree newTree(Composite parent, int style) {
Tree tree = new Tree(parent, style | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH);
@@ -258,9 +416,9 @@ public abstract class AbstractDialog ext
/**
* Styles = SWT.SINGLE / MULTI / CHECK / FULL_SELECTION / HIDE_SELECTION
- *
- * @param parent
- * @param style
+ *
+ * @param parent the parent
+ * @param style the style
* @return the new table widget
*/
protected Table newTable(Composite parent, int style) {
@@ -272,6 +430,13 @@ public abstract class AbstractDialog ext
return table;
}
+ /**
+ * Gets the hit column.
+ *
+ * @param item the item
+ * @param p the p
+ * @return the hit column
+ */
public int getHitColumn(TableItem item, Point p) {
for (int i = item.getParent().getColumnCount() - 1; i >= 0; i--) {
Rectangle columnBounds = item.getBounds(i);
@@ -281,6 +446,12 @@ public abstract class AbstractDialog ext
return -1;
}
+ /**
+ * New button container.
+ *
+ * @param parent the parent
+ * @return the composite
+ */
public Composite newButtonContainer(Composite parent) {
Composite buttonContainer = new Composite(parent, SWT.NONE);
buttonContainer.setLayout(new GridLayout());
@@ -289,6 +460,14 @@ public abstract class AbstractDialog ext
return buttonContainer;
}
+ /**
+ * New push button.
+ *
+ * @param parent the parent
+ * @param label the label
+ * @param tip the tip
+ * @return the button
+ */
public Button newPushButton(Composite parent, String label, String tip) {
Button button = new Button(parent, SWT.PUSH);
button.setText(label);
@@ -300,10 +479,21 @@ public abstract class AbstractDialog ext
return button;
}
+ /**
+ * New error message.
+ *
+ * @param c the c
+ */
protected void newErrorMessage(Composite c) {
newErrorMessage(c, 1);
}
+ /**
+ * New error message.
+ *
+ * @param twoCol the two col
+ * @param span the span
+ */
protected void newErrorMessage(Composite twoCol, int span) {
Label m = new Label(twoCol, SWT.WRAP);
m.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -312,6 +502,11 @@ public abstract class AbstractDialog ext
errorMessageUI = m;
}
+ /**
+ * Sets the error message.
+ *
+ * @param msg the new error message
+ */
protected void setErrorMessage(String msg) {
errorMessageUI.setText(msg);
Composite shell = errorMessageUI.getParent();
@@ -320,7 +515,11 @@ public abstract class AbstractDialog ext
shell.setSize(shell.computeSize(-1, -1));
}
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ */
// subclasses override, and often use super.handleEvent to call this
+ @Override
public void handleEvent(Event event) {
if (okButton != null) // may be null if handler called from
// main area setText event, during construction
@@ -328,11 +527,20 @@ public abstract class AbstractDialog ext
enableOK();
}
+ /**
+ * Super button pressed.
+ *
+ * @param buttonId the button id
+ */
protected void superButtonPressed(int buttonId) {
super.buttonPressed(buttonId);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
+ */
// overridden where needed
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
copyValuesFromGUI();
@@ -342,25 +550,51 @@ public abstract class AbstractDialog ext
super.buttonPressed(buttonId);
}
+ /**
+ * Copy values from GUI.
+ */
public abstract void copyValuesFromGUI();
+ /**
+ * Checks if is valid.
+ *
+ * @return true, if is valid
+ */
public abstract boolean isValid();
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createButtonBar(Composite c) {
Control returnValue = super.createButtonBar(c);
enableOK();
return returnValue;
}
+ /**
+ * Enable OK.
+ */
public abstract void enableOK();
+ /**
+ * Use qualified types.
+ *
+ * @return true, if successful
+ */
public boolean useQualifiedTypes() {
return MultiPageEditorContributor.getUseQualifiedTypes();
}
+ /**
+ * Gets the all types as sorted array.
+ *
+ * @return the all types as sorted array
+ */
protected String[] getAllTypesAsSortedArray() {
String[] allTypes = (String[]) section.editor.allTypes.get().keySet().toArray(stringArray0);
Arrays.sort(allTypes, new Comparator() {
+ @Override
public int compare(Object o1, Object o2) {
String shortName1 = AbstractSection.getShortName((String) o1);
String shortName2 = AbstractSection.getShortName((String) o2);
@@ -375,13 +609,26 @@ public abstract class AbstractDialog ext
return allTypes;
}
+ /**
+ * New labeled type input.
+ *
+ * @param aSection the a section
+ * @param parent the parent
+ * @param label the label
+ * @param tip the tip
+ * @return the text
+ */
protected Text newLabeledTypeInput(AbstractSection aSection, Composite parent, String label, String tip) {
setTextAndTip(new Label(parent, SWT.NONE), label, tip);
return newTypeInput(aSection, parent);
}
/**
- * @param twoCol
+ * New type input.
+ *
+ * @param aSection the a section
+ * @param twoCol the two col
+ * @return the text
*/
protected Text newTypeInput(AbstractSection aSection, Composite twoCol) {
Composite tc = new2ColumnComposite(twoCol);
@@ -416,6 +663,7 @@ public abstract class AbstractDialog ext
browseButton.removeListener(SWT.Selection, this);
final AbstractSection finalSection = aSection;
browseButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
errorMessageUI.setText("");
SelectTypeDialog dialog = new SelectTypeDialog(finalSection, candidatesToPickFrom);
@@ -458,14 +706,31 @@ public abstract class AbstractDialog ext
return text;
}
+ /**
+ * Text modify callback.
+ *
+ * @param e the e
+ */
public void textModifyCallback(Event e) {
}
+ /**
+ * Gets the type system info list.
+ *
+ * @return the type system info list
+ */
// default implementation - always overridden when used
public TypesWithNameSpaces getTypeSystemInfoList() {
return new TypesWithNameSpaces();
}
+ /**
+ * Type contained in type system info list.
+ *
+ * @param fullTypeName the full type name
+ * @param types the types
+ * @return true, if successful
+ */
protected boolean typeContainedInTypeSystemInfoList(String fullTypeName, TypesWithNameSpaces types) {
String key = AbstractSection.getShortName(fullTypeName);
String nameSpace = AbstractSection.getNameSpace(fullTypeName);
@@ -481,8 +746,8 @@ public abstract class AbstractDialog ext
/**
* In XML, a 0 - length string is represented as <xxx/>, while a null value causes the
* element to be omitted. Fix up values to be null if empty.
- *
- * @param v
+ *
+ * @param v the v
* @return null for 0 length string
*/
public static String nullIf0lengthString(String v) {
@@ -491,6 +756,12 @@ public abstract class AbstractDialog ext
return v;
}
+ /**
+ * Convert null.
+ *
+ * @param v the v
+ * @return the string
+ */
public static String convertNull(String v) {
if (null == v)
return "";
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerify.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerify.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerify.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerify.java Sun Nov 13 16:13:16 2016
@@ -29,17 +29,43 @@ import org.eclipse.swt.widgets.Label;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AbstractDialogKeyVerify.
+ */
public abstract class AbstractDialogKeyVerify extends AbstractDialog implements VerifyKeyListener {
+ /**
+ * Instantiates a new abstract dialog key verify.
+ *
+ * @param aSection the a section
+ * @param title the title
+ * @param description the description
+ */
protected AbstractDialogKeyVerify(AbstractSection aSection, String title, String description) {
super(aSection, title, description);
}
+ /**
+ * New labeled single line styled text.
+ *
+ * @param twoCol the two col
+ * @param label the label
+ * @param tip the tip
+ * @return the styled text
+ */
protected StyledText newLabeledSingleLineStyledText(Composite twoCol, String label, String tip) {
setTextAndTip(new Label(twoCol, SWT.NONE), label, tip);
return newSingleLineStyledText(twoCol, tip);
}
+ /**
+ * New single line styled text.
+ *
+ * @param parent the parent
+ * @param tip the tip
+ * @return the styled text
+ */
protected StyledText newSingleLineStyledText(Composite parent, String tip) {
StyledText w = new StyledText(parent, SWT.SINGLE | SWT.BORDER);
w.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -50,6 +76,10 @@ public abstract class AbstractDialogKeyV
return w;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.custom.VerifyKeyListener#verifyKey(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
public void verifyKey(VerifyEvent event) {
event.doit = true;
errorMessageUI.setText("");
@@ -62,7 +92,10 @@ public abstract class AbstractDialogKeyV
// overridden in methods needing other key checks
/**
- * Default verify key checks
+ * Default verify key checks.
+ *
+ * @param event the event
+ * @return true, if successful
*/
public boolean verifyKeyChecks(VerifyEvent event) {
return true;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerifyJavaNames.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerifyJavaNames.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerifyJavaNames.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogKeyVerifyJavaNames.java Sun Nov 13 16:13:16 2016
@@ -28,23 +28,42 @@ import org.eclipse.swt.widgets.Composite
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AbstractDialogKeyVerifyJavaNames.
+ */
public abstract class AbstractDialogKeyVerifyJavaNames extends AbstractDialogKeyVerify implements
VerifyKeyListener, VerifyListener {
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialogKeyVerify#newSingleLineStyledText(org.eclipse.swt.widgets.Composite, java.lang.String)
+ */
+ @Override
protected StyledText newSingleLineStyledText(Composite parent, String tip) {
StyledText w = super.newSingleLineStyledText(parent, tip);
w.addVerifyListener(this);
return w;
}
+ /**
+ * Instantiates a new abstract dialog key verify java names.
+ *
+ * @param aSection the a section
+ * @param title the title
+ * @param description the description
+ */
protected AbstractDialogKeyVerifyJavaNames(AbstractSection aSection, String title,
String description) {
super(aSection, title, description);
}
/**
- * Java name space names verify key checks for java identifier and periods
+ * Java name space names verify key checks for java identifier and periods.
+ *
+ * @param event the event
+ * @return true, if successful
*/
+ @Override
public boolean verifyKeyChecks(VerifyEvent event) {
if (event.keyCode == SWT.CR || event.keyCode == SWT.TAB)
return true;
@@ -62,14 +81,16 @@ public abstract class AbstractDialogKeyV
}
/**
- * @param event
- * the text change event.
+ * Verify text.
+ *
+ * @param event the text change event.
* <ul>
* <li>event.start - the replace start offset</li>
* <li>event.end - the replace end offset</li>
* <li>event.text - the new text</li>
* </ul>
*/
+ @Override
public void verifyText(VerifyEvent event) {
event.doit = true;
String oldStr = ((StyledText) event.widget).getText();
@@ -86,6 +107,12 @@ public abstract class AbstractDialogKeyV
}
}
+ /**
+ * Name part starts with digit.
+ *
+ * @param s the s
+ * @return true, if successful
+ */
private boolean namePartStartsWithDigit(final String s) {
if (null == s || s.length() == 0)
return false;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogMultiColTable.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogMultiColTable.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogMultiColTable.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AbstractDialogMultiColTable.java Sun Nov 13 16:13:16 2016
@@ -30,8 +30,18 @@ import org.eclipse.swt.widgets.Widget;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
import org.apache.uima.taeconfigurator.editors.ui.Utility;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AbstractDialogMultiColTable.
+ */
public abstract class AbstractDialogMultiColTable extends AbstractDialog {
+ /**
+ * Checked indicator.
+ *
+ * @param col the col
+ * @return the string
+ */
protected String checkedIndicator(int col) {
if (col == 1)
return "In";
@@ -39,20 +49,36 @@ public abstract class AbstractDialogMult
return "Out";
}
+ /** The Constant UNCHECKED. */
protected static final String UNCHECKED = "";
+ /** The table. */
Table table;
+ /** The enable col 1. */
protected boolean enableCol1 = true;
+ /** The enable col 2. */
protected boolean enableCol2 = true;
+ /** The number checked. */
protected int numberChecked = 0;
+ /**
+ * Instantiates a new abstract dialog multi col table.
+ *
+ * @param aSection the a section
+ * @param title the title
+ * @param description the description
+ */
protected AbstractDialogMultiColTable(AbstractSection aSection, String title, String description) {
super(aSection, title, description);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
public void handleEvent(Event event) {
if (event.type == SWT.MouseDown && event.widget == table) {
Point mousePosition = new Point(event.x, event.y);
@@ -81,12 +107,23 @@ public abstract class AbstractDialogMult
super.handleEvent(event);
}
+ /**
+ * Jit how to.
+ *
+ * @param w the w
+ */
private void jitHowTo(Widget w) {
Utility.popMessage(w, "Where to mouse click",
"Please click the mouse in the input or output columns to toggle the selection.",
MessageDialog.INFORMATION);
}
+ /**
+ * Toggle value.
+ *
+ * @param item the item
+ * @param col the col
+ */
protected void toggleValue(TableItem item, int col) {
item.setText(col, item.getText(col).equals(checkedIndicator(col)) ? UNCHECKED
: checkedIndicator(col));
@@ -96,15 +133,30 @@ public abstract class AbstractDialogMult
numberChecked--;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
errorMessageUI.setText("");
okButton.setEnabled(numberChecked > 0);
}
+ /**
+ * Sets the checked.
+ *
+ * @param item the item
+ * @param col the col
+ * @param value the value
+ */
protected void setChecked(TableItem item, int col, boolean value) {
boolean prevChecked = checkedIndicator(col).equals(item.getText(col));
item.setText(col, value ? checkedIndicator(col) : UNCHECKED);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddAllowedValueDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddAllowedValueDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddAllowedValueDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddAllowedValueDialog.java Sun Nov 13 16:13:16 2016
@@ -27,22 +27,32 @@ import org.eclipse.swt.widgets.Text;
import org.apache.uima.resource.metadata.AllowedValue;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddAllowedValueDialog.
+ */
public class AddAllowedValueDialog extends AbstractDialogKeyVerify {
+
+ /** The allowed value UI. */
private StyledText allowedValueUI;
+ /** The description UI. */
private Text descriptionUI;
+ /** The allowed value. */
public String allowedValue;
+ /** The description. */
public String description;
+ /** The existing av. */
private AllowedValue existingAv;
/**
* Constructor for Adding or Editing an Allowed Value.
- *
- * @param aSection
- * @param aExistingAv
+ *
+ * @param aSection the a section
+ * @param aExistingAv the a existing av
*/
public AddAllowedValueDialog(AbstractSection aSection, AllowedValue aExistingAv) {
super(aSection, "Add an Allowed Value for a String subtype",
@@ -50,6 +60,10 @@ public class AddAllowedValueDialog exten
existingAv = aExistingAv;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite) super.createDialogArea(parent, existingAv);
@@ -73,17 +87,29 @@ public class AddAllowedValueDialog exten
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
allowedValue = allowedValueUI.getText();
description = nullIf0lengthString(descriptionUI.getText());
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (allowedValue.length() == 0)
return false;
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(allowedValue.length() > 0);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityFeatureDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityFeatureDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityFeatureDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityFeatureDialog.java Sun Nov 13 16:13:16 2016
@@ -39,35 +39,56 @@ import org.apache.uima.taeconfigurator.e
import org.apache.uima.taeconfigurator.editors.ui.CapabilitySection;
import org.apache.uima.taeconfigurator.editors.ui.Utility;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddCapabilityFeatureDialog.
+ */
public class AddCapabilityFeatureDialog extends AbstractDialogMultiColTable {
+ /** The features. */
public String[] features; // this is the selection
+ /** The inputs. */
public boolean[] inputs;
+ /** The outputs. */
public boolean[] outputs;
+ /** The all features input. */
public boolean allFeaturesInput = false;
+ /** The all features output. */
public boolean allFeaturesOutput = false;
+ /** The all features. */
private Feature[] allFeatures;
+ /** The capability. */
private Capability capability;
+ /** The selected type. */
private Type selectedType;
+ /** The input not allowed. */
private boolean inputNotAllowed = true;
+ /** The feature array 0. */
private static Feature[] featureArray0 = new Feature[0];
+ /**
+ * Instantiates a new adds the capability feature dialog.
+ *
+ * @param aSection the a section
+ * @param aSelectedType the a selected type
+ * @param c the c
+ */
public AddCapabilityFeatureDialog(AbstractSection aSection, Type aSelectedType, Capability c) {
super(
aSection,
"Specify features input and / or output",
"Designate by mouse clicking one or more features in the Input and/or Output column, to designate as Input and/or Output press \"OK\"");
selectedType = aSelectedType;
- allFeatures = (Feature[]) selectedType.getFeatures().toArray(featureArray0);
+ allFeatures = selectedType.getFeatures().toArray(featureArray0);
Arrays.sort(allFeatures);
capability = c;
@@ -83,6 +104,10 @@ public class AddCapabilityFeatureDialog
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
@@ -96,10 +121,10 @@ public class AddCapabilityFeatureDialog
TableItem item = new TableItem(table, SWT.NONE);
item.setText(0, CapabilitySection.ALL_FEATURES);
- TypeOrFeature tof = CapabilitySection.getTypeOrFeature(capability.getInputs(), selectedType
+ TypeOrFeature tof = AbstractSection.getTypeOrFeature(capability.getInputs(), selectedType
.getName());
setChecked(item, 1, null == tof ? false : tof.isAllAnnotatorFeatures());
- tof = CapabilitySection.getTypeOrFeature(capability.getOutputs(), selectedType.getName());
+ tof = AbstractSection.getTypeOrFeature(capability.getOutputs(), selectedType.getName());
setChecked(item, 2, null == tof ? false : tof.isAllAnnotatorFeatures());
for (int i = 0; i < allFeatures.length; i++) {
@@ -117,15 +142,19 @@ public class AddCapabilityFeatureDialog
}
/**
- * return the actual type name : short-feature-name
- *
- * @param feature
+ * return the actual type name : short-feature-name.
+ *
+ * @param feature the feature
* @return the actual type name : short-feature-name
*/
protected String getTypeFeature(Feature feature) {
return selectedType.getName() + ':' + feature.getShortName();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialogMultiColTable#toggleValue(org.eclipse.swt.widgets.TableItem, int)
+ */
+ @Override
protected void toggleValue(TableItem item, int col) {
if (1 == col && inputNotAllowed) {
Utility.popMessage("Input not allowed",
@@ -141,6 +170,11 @@ public class AddCapabilityFeatureDialog
setChecked(table.getItem(0), col, false); // uncheck all-features
}
+ /**
+ * Uncheck all other features.
+ *
+ * @param column the column
+ */
private void uncheckAllOtherFeatures(int column) {
TableItem[] items = table.getItems();
for (int i = 1; i < items.length; i++) {
@@ -148,6 +182,10 @@ public class AddCapabilityFeatureDialog
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
List names = new ArrayList();
List ins = new ArrayList();
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityTypeDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityTypeDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityTypeDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddCapabilityTypeDialog.java Sun Nov 13 16:13:16 2016
@@ -35,28 +35,43 @@ import org.apache.uima.resource.metadata
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
import org.apache.uima.taeconfigurator.editors.ui.CapabilitySection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddCapabilityTypeDialog.
+ */
public class AddCapabilityTypeDialog extends AbstractDialogMultiColTable {
+ /** The types. */
public String[] types; // this is the selection
+ /** The inputs. */
public boolean[] inputs;
+ /** The outputs. */
public boolean[] outputs;
+ /** The Constant NAME. */
private static final int NAME = 0;
+ /** The Constant INPUT. */
private static final int INPUT = 1;
+ /** The Constant OUTPUT. */
private static final int OUTPUT = 2;
+ /** The Constant NAMESPACE. */
private static final int NAMESPACE = 3;
+ /** The capability section. */
CapabilitySection capabilitySection;
+ /** The capability. */
private Capability capability;
+ /** The existing. */
private TableTreeItem existing = null;
+ /** The excluded types. */
private static List excludedTypes = new ArrayList();
{
excludedTypes.add(CAS.TYPE_NAME_ARRAY_BASE);
@@ -94,6 +109,12 @@ public class AddCapabilityTypeDialog ext
excludedTypes.add(CAS.TYPE_NAME_TOP);
}
+ /**
+ * Instantiates a new adds the capability type dialog.
+ *
+ * @param aSection the a section
+ * @param c the c
+ */
public AddCapabilityTypeDialog(AbstractSection aSection, Capability c) {
super(aSection, "Add Types to a Capability Set", "Mark one or more types as "
+ ((aSection.isCasConsumerDescriptor()) ? "Input"
@@ -106,11 +127,22 @@ public class AddCapabilityTypeDialog ext
enableCol2 = !aSection.isCasConsumerDescriptor();
}
+ /**
+ * Instantiates a new adds the capability type dialog.
+ *
+ * @param aSection the a section
+ * @param c the c
+ * @param aExisting the a existing
+ */
public AddCapabilityTypeDialog(AbstractSection aSection, Capability c, TableTreeItem aExisting) {
this(aSection, c);
existing = aExisting;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent, existing);
@@ -137,10 +169,10 @@ public class AddCapabilityTypeDialog ext
TableItem item = new TableItem(table, SWT.NONE);
item.setText(NAME, existing.getText(CapabilitySection.NAME_COL));
item.setText(NAMESPACE, existing.getText(CapabilitySection.NAMESPACE_COL));
- TypeOrFeature tof = CapabilitySection.getTypeOrFeature(capability.getInputs(),
+ TypeOrFeature tof = AbstractSection.getTypeOrFeature(capability.getInputs(),
capabilitySection.getFullyQualifiedName(existing));
setChecked(item, 1, null != tof);
- tof = CapabilitySection.getTypeOrFeature(capability.getOutputs(), capabilitySection
+ tof = AbstractSection.getTypeOrFeature(capability.getOutputs(), capabilitySection
.getFullyQualifiedName(existing));
setChecked(item, 2, null != tof);
}
@@ -153,6 +185,13 @@ public class AddCapabilityTypeDialog ext
return composite;
}
+ /**
+ * Checks for type.
+ *
+ * @param items the items
+ * @param name the name
+ * @return true, if successful
+ */
private boolean hasType(TypeOrFeature[] items, String name) {
if (null == items)
return false;
@@ -164,8 +203,9 @@ public class AddCapabilityTypeDialog ext
}
/**
- * Return values having at least one of input or output selected
+ * Return values having at least one of input or output selected.
*/
+ @Override
public void copyValuesFromGUI() {
List names = new ArrayList();
List ins = new ArrayList();
@@ -192,12 +232,22 @@ public class AddCapabilityTypeDialog ext
}
}
+ /**
+ * Sets the gui type name.
+ *
+ * @param item the item
+ * @param typeName the type name
+ */
// used by dialog
public void setGuiTypeName(TableItem item, String typeName) {
item.setText(NAME, AbstractSection.getShortName(typeName));
item.setText(NAMESPACE, AbstractSection.getNameSpace(typeName));
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialogMultiColTable#isValid()
+ */
+ @Override
public boolean isValid() {
for (int i = 0; i < types.length; i++) {
if (!inputs[i]) {
@@ -219,10 +269,10 @@ public class AddCapabilityTypeDialog ext
}
/**
- * return true if the type has a feature (except all-features) marked as INPUT (OUTPUT)
- *
- * @param typeName
- * @param IO
+ * return true if the type has a feature (except all-features) marked as INPUT (OUTPUT).
+ *
+ * @param typeName the type name
+ * @param IO the io
* @return true if the type has a feature (except all-features) marked as INPUT (OUTPUT)
*/
private boolean someFeatureOnType(String typeName, int IO) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDependencyDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDependencyDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDependencyDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDependencyDialog.java Sun Nov 13 16:13:16 2016
@@ -30,40 +30,60 @@ import org.apache.uima.resource.External
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
import org.apache.uima.taeconfigurator.editors.ui.ResourceDependencySection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddExternalResourceDependencyDialog.
+ */
public class AddExternalResourceDependencyDialog extends AbstractDialogKeyVerifyJavaNames {
+ /** The key name UI. */
private StyledText keyNameUI;
+ /** The optional UI. */
public Button optionalUI;
+ /** The interface name UI. */
private StyledText interfaceNameUI;
+ /** The description UI. */
private Text descriptionUI;
+ /** The key name. */
public String keyName;
+ /** The original key name. */
private String originalKeyName;
+ /** The optional. */
public boolean optional;
+ /** The interface name. */
public String interfaceName;
+ /** The description. */
public String description;
+ /** The rd section. */
private ResourceDependencySection rdSection;
+ /** The existing XRD. */
private ExternalResourceDependency existingXRD;
+ /**
+ * Instantiates a new adds the external resource dependency dialog.
+ *
+ * @param aSection the a section
+ */
public AddExternalResourceDependencyDialog(AbstractSection aSection) {
super(aSection, "Add External Resource Dependency", "Add an External Resource Dependency");
rdSection = (ResourceDependencySection) aSection;
}
/**
- * Constructor for Editing an existing XRD
- *
- * @param aSection
- * @param aExistingXRD
+ * Constructor for Editing an existing XRD.
+ *
+ * @param aSection the a section
+ * @param aExistingXRD the a existing XRD
*/
public AddExternalResourceDependencyDialog(AbstractSection aSection,
ExternalResourceDependency aExistingXRD) {
@@ -71,6 +91,10 @@ public class AddExternalResourceDependen
existingXRD = aExistingXRD;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite) super.createDialogArea(parent, existingXRD);
createWideLabel(
@@ -112,6 +136,10 @@ public class AddExternalResourceDependen
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
keyName = keyNameUI.getText();
optional = optionalUI.getSelection();
@@ -119,6 +147,10 @@ public class AddExternalResourceDependen
interfaceName = nullIf0lengthString(interfaceNameUI.getText());
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (keyName.length() == 0)
return false;
@@ -127,6 +159,10 @@ public class AddExternalResourceDependen
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(keyName.length() > 0);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddExternalResourceDialog.java Sun Nov 13 16:13:16 2016
@@ -35,39 +35,67 @@ import org.apache.uima.taeconfigurator.e
import org.apache.uima.taeconfigurator.editors.ui.ExtnlResBindSection;
import org.apache.uima.taeconfigurator.editors.ui.Utility;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddExternalResourceDialog.
+ */
public class AddExternalResourceDialog extends AbstractDialogKeyVerify {
+ /** The existing XRD. */
private ExternalResourceDescription existingXRD = null;
+ /** The xr name UI. */
private StyledText xrNameUI;
+ /** The original xr name. */
private String originalXrName;
+ /** The xr description UI. */
private Text xrDescriptionUI;
+ /** The xr url UI. */
private StyledText xrUrlUI;
+ /** The xr url suffix UI. */
private StyledText xrUrlSuffixUI;
+ /** The xr implementation UI. */
private StyledText xrImplementationUI;
+ /** The extnl res bind section. */
private ExtnlResBindSection extnlResBindSection;
+ /** The xr name. */
public String xrName;
+ /** The xr description. */
public String xrDescription;
+ /** The xr url. */
public String xrUrl;
+ /** The xr url suffix. */
public String xrUrlSuffix;
+ /** The xr implementation. */
public String xrImplementation;
+ /**
+ * Instantiates a new adds the external resource dialog.
+ *
+ * @param aSection the a section
+ */
public AddExternalResourceDialog(AbstractSection aSection) {
super(aSection, "Add an External Resource Definition", "Define and name an external resource");
extnlResBindSection = (ExtnlResBindSection) aSection;
}
+ /**
+ * Instantiates a new adds the external resource dialog.
+ *
+ * @param aSection the a section
+ * @param aExistingXRD the a existing XRD
+ */
public AddExternalResourceDialog(AbstractSection aSection,
ExternalResourceDescription aExistingXRD) {
this(aSection);
@@ -75,6 +103,10 @@ public class AddExternalResourceDialog e
originalXrName = existingXRD.getName();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent, existingXRD);
@@ -131,6 +163,10 @@ public class AddExternalResourceDialog e
return composite;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
xrName = xrNameUI.getText();
xrDescription = nullIf0lengthString(xrDescriptionUI.getText());
@@ -140,8 +176,12 @@ public class AddExternalResourceDialog e
}
/**
- * Called for many widgets
+ * Called for many widgets.
+ *
+ * @param event the event
+ * @return true, if successful
*/
+ @Override
public boolean verifyKeyChecks(VerifyEvent event) {
if (event.keyCode == SWT.CR || event.keyCode == SWT.TAB)
return true;
@@ -155,6 +195,10 @@ public class AddExternalResourceDialog e
return false;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (xrName.length() == 0)
return false;
@@ -165,6 +209,10 @@ public class AddExternalResourceDialog e
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(xrName.length() > 0 && xrUrl.length() > 0);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddFeatureDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddFeatureDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddFeatureDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddFeatureDialog.java Sun Nov 13 16:13:16 2016
@@ -34,54 +34,79 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddFeatureDialog.
+ */
public class AddFeatureDialog extends AbstractDialogKeyVerify {
+ /** The Constant ONLY_NON_PRIMITIVE_TYPES. */
private static final int ONLY_NON_PRIMITIVE_TYPES = 0;
+ /** The Constant ALL_TYPES. */
private static final int ALL_TYPES = 1;
+ /** The feature name UI. */
private StyledText featureNameUI;
+ /** The feature range name UI. */
private Text featureRangeNameUI;
+ /** The description UI. */
private Text descriptionUI;
+ /** The feature name. */
public String featureName;
+ /** The original feature name. */
private String originalFeatureName;
+ /** The feature range name. */
public String featureRangeName;
+ /** The description. */
public String description;
+ /** The element range name. */
public String elementRangeName;
+ /** The multi ref. */
public Boolean multiRef;
+ /** The type section. */
private TypeSection typeSection;
+ /** The td. */
private TypeDescription td;
+ /** The existing fd. */
private FeatureDescription existingFd;
+ /** The all types list. */
private TypesWithNameSpaces allTypesList;
+ /** The multi ref composite. */
private Composite multiRefComposite;
+ /** The multi ref UI. */
private CCombo multiRefUI;
+ /** The element type composite. */
private Composite elementTypeComposite;
+ /** The element range name UI. */
private Text elementRangeNameUI;
+ /** The type filter. */
private int typeFilter;
/**
- *
- * @param aSection
- * @param aTd
- * @param aExistingFd
+ * Instantiates a new adds the feature dialog.
+ *
+ * @param aSection the a section
+ * @param aTd the a td
+ * @param aExistingFd the a existing fd
*/
public AddFeatureDialog(AbstractSection aSection, TypeDescription aTd,
FeatureDescription aExistingFd) {
@@ -91,6 +116,10 @@ public class AddFeatureDialog extends Ab
existingFd = aExistingFd;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite) super.createDialogArea(parent, existingFd);
createWideLabel(mainArea, "The feature name must be unique within this type");
@@ -143,6 +172,9 @@ public class AddFeatureDialog extends Ab
return mainArea;
}
+ /**
+ * Manage visible fields.
+ */
private void manageVisibleFields() {
String range = featureRangeNameUI.getText();
if (AbstractSection.isArrayOrListType(range)) {
@@ -160,12 +192,20 @@ public class AddFeatureDialog extends Ab
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
public void handleEvent(Event event) {
super.handleEvent(event);
if (event.type == SWT.Modify && event.widget == featureRangeNameUI)
manageVisibleFields();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#getTypeSystemInfoList()
+ */
+ @Override
public TypesWithNameSpaces getTypeSystemInfoList() {
TypesWithNameSpaces result = super.getTypeSystemInfoList();
Type[] allTypes = (Type[]) editor.allTypes.get().values().toArray(new Type[0]);
@@ -193,13 +233,17 @@ public class AddFeatureDialog extends Ab
return result;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
featureName = featureNameUI.getText();
description = nullIf0lengthString(descriptionUI.getText());
featureRangeName = featureRangeNameUI.getText();
multiRef = (1 == multiRefUI.getSelectionIndex()) ? Boolean.FALSE : (2 == multiRefUI
.getSelectionIndex()) ? Boolean.TRUE : null;
- if (TypeSection.isFSArrayOrListType(featureRangeName)) {
+ if (AbstractSection.isFSArrayOrListType(featureRangeName)) {
elementRangeName = elementRangeNameUI.getText();
if ("".equals(elementRangeName)) {
elementRangeName = null;
@@ -209,6 +253,10 @@ public class AddFeatureDialog extends Ab
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialogKeyVerify#verifyKeyChecks(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
public boolean verifyKeyChecks(VerifyEvent event) {
if (event.keyCode == SWT.CR || event.keyCode == SWT.TAB)
return true;
@@ -219,6 +267,10 @@ public class AddFeatureDialog extends Ab
return false;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (featureName.length() == 0 || featureRangeName.length() == 0)
@@ -238,10 +290,18 @@ public class AddFeatureDialog extends Ab
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#textModifyCallback(org.eclipse.swt.widgets.Event)
+ */
+ @Override
public void textModifyCallback(Event e) {
manageVisibleFields();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(featureName.length() > 0 && featureRangeName.length() > 0);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexDialog.java Sun Nov 13 16:13:16 2016
@@ -41,66 +41,100 @@ import org.eclipse.swt.widgets.TableColu
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddIndexDialog.
+ */
public class AddIndexDialog extends AbstractDialogKeyVerifyJavaNames {
+ /** The Constant TYPE_PRIORITY. */
private static final String TYPE_PRIORITY = "Type Priority";
+ /** The Constant STANDARD. */
private static final String STANDARD = "Standard";
+ /** The Constant REVERSE. */
private static final String REVERSE = "Reverse";
+ /** The index name UI. */
private StyledText indexNameUI;
+ /** The index type UI. */
private Text indexTypeUI;
+ /** The index kind UI. */
private CCombo indexKindUI;
+ /** The table. */
private Table table;
+ /** The add button. */
private Button addButton;
+ /** The edit button. */
private Button editButton;
+ /** The remove button. */
private Button removeButton;
+ /** The up button. */
private Button upButton;
+ /** The down button. */
private Button downButton;
+ /** The table container. */
private Composite tableContainer;
+ /** The key table. */
private Label keyTable;
+ /** The index name. */
public String indexName;
+ /** The index type. */
public String indexType;
+ /** The index kind. */
public String indexKind;
+ /** The keys. */
public FsIndexKeyDescription[] keys;
+ /** The original index name. */
private String originalIndexName;
+ /** The index section. */
private IndexSection indexSection;
+ /** The existing NDX. */
private FsIndexDescription existingNDX;
+ /**
+ * Instantiates a new adds the index dialog.
+ *
+ * @param aSection the a section
+ */
public AddIndexDialog(AbstractSection aSection) {
super(aSection, "Add an index", "Add or Edit an index specification");
indexSection = (IndexSection) aSection;
}
/**
- * Constructor for Editing an existing XRD
- *
- * @param aSection
- * @param aExistingNDX
+ * Constructor for Editing an existing XRD.
+ *
+ * @param aSection the a section
+ * @param aExistingNDX the a existing NDX
*/
public AddIndexDialog(AbstractSection aSection, FsIndexDescription aExistingNDX) {
this(aSection);
existingNDX = aExistingNDX;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite) super.createDialogArea(parent, existingNDX);
createWideLabel(mainArea, "The Index name must be globally unique.");
@@ -174,6 +208,10 @@ public class AddIndexDialog extends Abst
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#getTypeSystemInfoList()
+ */
+ @Override
public TypesWithNameSpaces getTypeSystemInfoList() {
TypesWithNameSpaces result = super.getTypeSystemInfoList();
String[] allTypes = getAllTypesAsSortedArray();
@@ -183,6 +221,11 @@ public class AddIndexDialog extends Abst
return result;
}
+ /**
+ * Adds the key.
+ *
+ * @param key the key
+ */
private void addKey(FsIndexKeyDescription key) {
if (null == key)
return;
@@ -190,6 +233,12 @@ public class AddIndexDialog extends Abst
updateKey(item, key);
}
+ /**
+ * Update key.
+ *
+ * @param item the item
+ * @param key the key
+ */
private void updateKey(TableItem item, FsIndexKeyDescription key) {
if (null == key)
return;
@@ -203,6 +252,10 @@ public class AddIndexDialog extends Abst
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
public void handleEvent(Event event) {
if (event.widget == indexKindUI) {
boolean showKeys = "sorted".equals(indexKindUI.getText())
@@ -236,6 +289,12 @@ public class AddIndexDialog extends Abst
super.handleEvent(event);
}
+ /**
+ * Already defined.
+ *
+ * @param items the items
+ * @return the list
+ */
public List alreadyDefined(TableItem[] items) {
List result = new ArrayList();
if (null == items)
@@ -246,6 +305,10 @@ public class AddIndexDialog extends Abst
return result;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
indexName = indexNameUI.getText();
indexKind = indexKindUI.getText();
@@ -260,6 +323,12 @@ public class AddIndexDialog extends Abst
keys = null;
}
+ /**
+ * Make key.
+ *
+ * @param item the item
+ * @return the fs index key description
+ */
private FsIndexKeyDescription makeKey(TableItem item) {
FsIndexKeyDescription key = UIMAFramework.getResourceSpecifierFactory()
.createFsIndexKeyDescription();
@@ -273,6 +342,10 @@ public class AddIndexDialog extends Abst
return key;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (indexName.length() == 0 || indexType.length() == 0)
return false;
@@ -284,6 +357,10 @@ public class AddIndexDialog extends Abst
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(indexName.length() > 0);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexKeyDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexKeyDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexKeyDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddIndexKeyDialog.java Sun Nov 13 16:13:16 2016
@@ -37,37 +37,62 @@ import org.apache.uima.cas.admin.FSIndex
import org.apache.uima.resource.metadata.FsIndexKeyDescription;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddIndexKeyDialog.
+ */
public class AddIndexKeyDialog extends AbstractDialog {
+ /** The Constant ASCENDING. */
static private final String ASCENDING = "Ascending (Standard)";
+ /** The Constant DESCENDING. */
static private final String DESCENDING = "Descending (Reverse)";
+ /** The Constant TYPE_PRIORITY. */
static private final String TYPE_PRIORITY = "Type Priority";
+ /** The type priority. */
public boolean typePriority;
+ /** The feature name. */
public String featureName;
+ /** The direction. */
public int direction;
+ /** The features. */
private String[] features;
+ /** The existing key. */
private FsIndexKeyDescription existingKey = null;
+ /** The already used keys. */
private List alreadyUsedKeys;
+ /** The index kind. */
private String indexKind; // bag, sorted, set
+ /** The feature UI. */
private CCombo featureUI;
+ /** The kind UI. */
// private Button browseButton;
private CCombo kindUI;
+ /** The feature label. */
private Label featureLabel;
// private Composite tc;
+ /**
+ * Instantiates a new adds the index key dialog.
+ *
+ * @param aSection the a section
+ * @param typeName the type name
+ * @param indexKind the index kind
+ * @param alreadyUsedKeys the already used keys
+ */
public AddIndexKeyDialog(AbstractSection aSection, String typeName, String indexKind,
List alreadyUsedKeys) {
super(aSection, "Add index key", "Add or edit an index key for a type");
@@ -76,6 +101,15 @@ public class AddIndexKeyDialog extends A
features = getSortableFeatureNames(typeName);
}
+ /**
+ * Instantiates a new adds the index key dialog.
+ *
+ * @param aSection the a section
+ * @param typeName the type name
+ * @param indexKind the index kind
+ * @param alreadyUsedKeys the already used keys
+ * @param existingKey the existing key
+ */
public AddIndexKeyDialog(AbstractSection aSection, String typeName, String indexKind,
List alreadyUsedKeys, FsIndexKeyDescription existingKey) {
this(aSection, typeName, indexKind, alreadyUsedKeys);
@@ -83,9 +117,9 @@ public class AddIndexKeyDialog extends A
}
/**
- *
- * @param taeDescription
- * @param selectedType
+ * Gets the sortable feature names.
+ *
+ * @param selectedTypeName the selected type name
* @return an array of features whose range is primitive
*/
private String[] getSortableFeatureNames(String selectedTypeName) {
@@ -109,6 +143,10 @@ public class AddIndexKeyDialog extends A
// Kind: combo (up, down, or typePriority)
// Feature: text with assist <browse>
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
// create composite
Composite mainComposite = (Composite) super.createDialogArea(parent, existingKey);
@@ -149,6 +187,10 @@ public class AddIndexKeyDialog extends A
return mainComposite;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
public void handleEvent(Event event) {
if (event.widget == kindUI) {
boolean makeFeatureVisible = "set".equals(indexKind)
@@ -159,11 +201,19 @@ public class AddIndexKeyDialog extends A
super.handleEvent(event);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(typePriority || !(null != featureName && "".equals(featureName)));
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
if ("sorted".equals(indexKind) && TYPE_PRIORITY.equals(kindUI.getText())) {
typePriority = true;
@@ -179,6 +229,10 @@ public class AddIndexKeyDialog extends A
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
return true;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddParameterDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddParameterDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddParameterDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddParameterDialog.java Sun Nov 13 16:13:16 2016
@@ -40,49 +40,75 @@ import org.eclipse.swt.widgets.Composite
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Text;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddParameterDialog.
+ */
public class AddParameterDialog extends AbstractDialogKeyVerifyJavaNames {
+
+ /** The parm name UI. */
private StyledText parmNameUI;
+ /** The ext parm name UI. */
private StyledText extParmNameUI;
+ /** The multi value UI. */
public Button multiValueUI;
+ /** The mandatory UI. */
private Button mandatoryUI;
+ /** The parm type UI. */
public CCombo parmTypeUI;
+ /** The description UI. */
private Text descriptionUI;
+ /** The parm name. */
public String parmName;
+ /** The ext parm name. */
public String extParmName;
+ /** The multi value. */
public boolean multiValue;
+ /** The mandatory. */
public boolean mandatory;
+ /** The parm type. */
public String parmType;
+ /** The description. */
public String description;
+ /** The parm section. */
private ParameterSection parmSection;
+ /** The existing CP. */
private ConfigurationParameter existingCP;
+ /** The original parm name. */
private String originalParmName;
+ /** The config group. */
private ConfigGroup configGroup;
+ /**
+ * Instantiates a new adds the parameter dialog.
+ *
+ * @param aSection the a section
+ */
private AddParameterDialog(AbstractSection aSection) {
super(aSection, "Add Parameter", "Specify a parameter name && type");
parmSection = (ParameterSection) section;
}
/**
- * Constructor for Editing an existing parameter
- *
- * @param aSection
- * @param aExistingCP
+ * Constructor for Editing an existing parameter.
+ *
+ * @param aSection the a section
+ * @param aExistingCP the a existing CP
*/
public AddParameterDialog(AbstractSection aSection, ConfigurationParameter aExistingCP) {
this(aSection);
@@ -90,16 +116,20 @@ public class AddParameterDialog extends
}
/**
- * Constructor for Adding a new parameter to a group (may be the not-in-any one)
- *
- * @param aSection
- * @param cg
+ * Constructor for Adding a new parameter to a group (may be the not-in-any one).
+ *
+ * @param aSection the a section
+ * @param cg the cg
*/
public AddParameterDialog(AbstractSection aSection, ConfigGroup cg) {
this(aSection);
configGroup = cg;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite) super.createDialogArea(parent, existingCP);
createWideLabel(mainArea, "Parameter names must be unique within this descriptor");
@@ -156,6 +186,10 @@ public class AddParameterDialog extends
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
parmName = parmNameUI.getText();
multiValue = multiValueUI.getSelection();
@@ -165,6 +199,10 @@ public class AddParameterDialog extends
extParmName = nullIf0lengthString(extParmNameUI.getText());
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (parmName.length() == 0)
return false;
@@ -175,6 +213,10 @@ public class AddParameterDialog extends
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled((parmName.length() > 0) && (parmType.length() > 0));
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddRemoteServiceDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddRemoteServiceDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddRemoteServiceDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddRemoteServiceDialog.java Sun Nov 13 16:13:16 2016
@@ -21,7 +21,6 @@ package org.apache.uima.taeconfigurator.
import java.text.MessageFormat;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.ModifyEvent;
@@ -38,99 +37,164 @@ import org.eclipse.swt.widgets.Text;
import org.apache.uima.taeconfigurator.CDEpropertyPage;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddRemoteServiceDialog.
+ */
public class AddRemoteServiceDialog extends AbstractDialog {
+ /** The m selected service type name. */
private String m_selectedServiceTypeName = null;
+ /** The m selected uri. */
private String m_selectedUri = null;
+ /** The m selected key. */
private String m_selectedKey = null;
+ /** The m b auto add to flow. */
private boolean m_bAutoAddToFlow;
+ /** The vns port. */
public String vnsPort;
+ /** The vns host. */
public String vnsHost;
+ /** The timeout. */
public String timeout;
+ /** The ae or cc. */
public String aeOrCc;
+ /** The service type combo. */
private CCombo serviceTypeCombo;
+ /** The uri text. */
private Text uriText;
+ /** The endpoint text. */
private Text endpointText;
+ /** The key text. */
private Text keyText;
+ /** The timeout text. */
private Text timeoutText;
+ /** The auto add to flow button. */
private Button autoAddToFlowButton;
+ /** The import by name UI. */
private Button importByNameUI;
+ /** The import by location UI. */
private Button importByLocationUI;
+ /** The is import by name. */
public boolean isImportByName;
+ /** The root path. */
private String rootPath;
+ /** The m dialog modify listener. */
private DialogModifyListener m_dialogModifyListener = new DialogModifyListener();
+ /** The gen file path UI. */
private Text genFilePathUI;
+ /** The gen file path. */
public String genFilePath;
+ /** The key text prev. */
private String keyTextPrev;
+ /** The vns host label. */
private Label vnsHostLabel;
+ /** The vns host UI. */
private Text vnsHostUI;
+ /** The vns port label. */
private Label vnsPortLabel;
+ /** The vns port UI. */
private Text vnsPortUI;
+ /** The port number was bad. */
private boolean portNumberWasBad;
+ /** The port number is OK. */
private boolean portNumberIsOK;
+ /** The ae or cc combo. */
private CCombo aeOrCcCombo;
+ /** The endpoint label. */
private Label endpointLabel;
+ /** The uri label. */
private Label uriLabel;
+ /** The timeout process label. */
private Label timeoutProcessLabel;
+ /** The timeout jms getmeta label. */
private Label timeoutJmsGetmetaLabel;
+ /** The timeout getmeta text. */
private Text timeoutGetmetaText;
+ /** The getmeta timeout. */
public String getmetaTimeout;
+ /** The endpoint. */
public String endpoint;
+ /** The timeout jms cpc text. */
private Text timeoutJmsCpcText;
+ /** The timeout jms cpc label. */
private Label timeoutJmsCpcLabel;
+ /** The binary serialization label. */
private Label binarySerializationLabel;
+ /** The binary serialization combo. */
private CCombo binarySerializationCombo;
+ /** The ignore process errors label. */
private Label ignoreProcessErrorsLabel;
+ /** The ignore process errors combo. */
private CCombo ignoreProcessErrorsCombo;
+ /** The cpc timeout. */
public String cpcTimeout;
+ /** The binary serialization. */
public String binary_serialization;
+ /** The ignore process errors. */
public String ignore_process_errors;
+ /**
+ * The listener interface for receiving dialogModify events.
+ * The class that is interested in processing a dialogModify
+ * event implements this interface, and the object created
+ * with that class is registered with a component using the
+ * component's <code>addDialogModifyListener</code> method. When
+ * the dialogModify event occurs, that object's appropriate
+ * method is invoked.
+ *
+ * @see DialogModifyEvent
+ */
private class DialogModifyListener implements ModifyListener {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ */
+ @Override
public void modifyText(ModifyEvent e) {
String text = genFilePathUI.getText();
int pos = text.lastIndexOf(keyTextPrev);
@@ -143,7 +207,23 @@ public class AddRemoteServiceDialog exte
}
}
+ /**
+ * The listener interface for receiving dialogVerify events.
+ * The class that is interested in processing a dialogVerify
+ * event implements this interface, and the object created
+ * with that class is registered with a component using the
+ * component's <code>addDialogVerifyListener</code> method. When
+ * the dialogVerify event occurs, that object's appropriate
+ * method is invoked.
+ *
+ * @see DialogVerifyEvent
+ */
private class DialogVerifyListener implements VerifyListener {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.VerifyListener#verifyText(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
public void verifyText(VerifyEvent e) {
if (0 <= e.text.indexOf('.')) {
setErrorMessage(MessageFormat.format("invalid character(s): ''{0}''",
@@ -154,12 +234,22 @@ public class AddRemoteServiceDialog exte
}
}
+ /**
+ * Instantiates a new adds the remote service dialog.
+ *
+ * @param aSection the a section
+ * @param aRootPath the a root path
+ */
public AddRemoteServiceDialog(AbstractSection aSection, String aRootPath) {
super(aSection, "Add Remote Service",
"Fill in the information about the remote service and press OK");
rootPath = aRootPath;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
@@ -261,6 +351,14 @@ public class AddRemoteServiceDialog exte
return composite;
}
+ /**
+ * Wide C combo.
+ *
+ * @param tc the tc
+ * @param tip the tip
+ * @param entries the entries
+ * @return the c combo
+ */
private CCombo wideCCombo(Composite tc, String tip, String ... entries) {
CCombo cc = newCCombo(tc, tip);
for (String e : entries) {
@@ -271,14 +369,36 @@ public class AddRemoteServiceDialog exte
return cc;
}
+ /**
+ * Wide C combo TF.
+ *
+ * @param tc the tc
+ * @param tip the tip
+ * @return the c combo
+ */
private CCombo wideCComboTF(Composite tc, String tip) {
return wideCCombo(tc, tip, "false", "true");
}
+ /**
+ * Wide text input.
+ *
+ * @param tc the tc
+ * @param tip the tip
+ * @return the text
+ */
private Text wideTextInput(Composite tc, String tip) {
return wideTextInput(tc, tip, null);
}
+ /**
+ * Wide text input.
+ *
+ * @param tc the tc
+ * @param tip the tip
+ * @param listener the listener
+ * @return the text
+ */
private Text wideTextInput(Composite tc, String tip, DialogModifyListener listener) {
Text t = newText(tc, SWT.BORDER, tip);
t.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
@@ -291,6 +411,10 @@ public class AddRemoteServiceDialog exte
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
boolean isVinci = serviceTypeCombo.getSelectionIndex() == 2;
boolean isJms = serviceTypeCombo.getSelectionIndex() == 0;
@@ -348,18 +472,38 @@ public class AddRemoteServiceDialog exte
}
}
+ /**
+ * Gets the selected service type name.
+ *
+ * @return the selected service type name
+ */
public String getSelectedServiceTypeName() {
return m_selectedServiceTypeName;
}
+ /**
+ * Gets the selected uri.
+ *
+ * @return the selected uri
+ */
public String getSelectedUri() {
return m_selectedUri;
}
+ /**
+ * Gets the selected key.
+ *
+ * @return the selected key
+ */
public String getSelectedKey() {
return m_selectedKey;
}
+ /**
+ * Gets the auto add to flow.
+ *
+ * @return the auto add to flow
+ */
public boolean getAutoAddToFlow() {
return m_bAutoAddToFlow;
}
@@ -369,6 +513,7 @@ public class AddRemoteServiceDialog exte
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
*/
+ @Override
public void copyValuesFromGUI() {
genFilePath = genFilePathUI.getText();
isImportByName = importByNameUI.getSelection();
@@ -388,6 +533,10 @@ public class AddRemoteServiceDialog exte
ignore_process_errors = ignoreProcessErrorsCombo.getText();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
return true;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddSofaDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddSofaDialog.java?rev=1769512&r1=1769511&r2=1769512&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddSofaDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddSofaDialog.java Sun Nov 13 16:13:16 2016
@@ -33,28 +33,48 @@ import org.apache.uima.resource.metadata
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
import org.apache.uima.taeconfigurator.editors.ui.CapabilitySection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddSofaDialog.
+ */
public class AddSofaDialog extends AbstractDialogKeyVerify {
+ /** The sofa name UI. */
private StyledText sofaNameUI;
+ /** The capability section. */
private CapabilitySection capabilitySection;
+ /** The capability. */
private Capability capability;
+ /** The existing sofa. */
private String existingSofa;
+ /** The existing is input. */
private boolean existingIsInput;
+ /** The original sofa. */
private String originalSofa;
+ /** The sofa name. */
public String sofaName;
+ /** The is input. */
public boolean isInput;
+ /** The input button. */
private Button inputButton;
+ /** The output button. */
private Button outputButton;
+ /**
+ * Instantiates a new adds the sofa dialog.
+ *
+ * @param aSection the a section
+ * @param c the c
+ */
public AddSofaDialog(AbstractSection aSection, Capability c) {
super(aSection, "Add a Sofa", "Use this panel to specify a Sofa Name.");
capabilitySection = (CapabilitySection) aSection;
@@ -62,12 +82,12 @@ public class AddSofaDialog extends Abstr
}
/**
- * Constructor for Editing an existing Sofa Name
- *
- * @param aSection
- * @param c
- * @param aExistingSofa
- * @param aIsInput
+ * Constructor for Editing an existing Sofa Name.
+ *
+ * @param aSection the a section
+ * @param c the c
+ * @param aExistingSofa the a existing sofa
+ * @param aIsInput the a is input
*/
public AddSofaDialog(AbstractSection aSection, Capability c, String aExistingSofa,
boolean aIsInput) {
@@ -76,6 +96,10 @@ public class AddSofaDialog extends Abstr
existingIsInput = aIsInput;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite) super.createDialogArea(parent, existingSofa);
createWideLabel(mainArea, "Sofa names must be unique within a Capability Set, and are"
@@ -127,6 +151,10 @@ public class AddSofaDialog extends Abstr
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
sofaName = sofaNameUI.getText();
isInput = inputButton.getSelection();
@@ -135,7 +163,10 @@ public class AddSofaDialog extends Abstr
/**
* Duplicate validity check: Duplicates are OK for sofas belonging to other capability sets,
* provided they have the same Input or Output setting.
+ *
+ * @return true, if is valid
*/
+ @Override
public boolean isValid() {
if (sofaName.length() == 0)
return false;
@@ -157,11 +188,20 @@ public class AddSofaDialog extends Abstr
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(sofaName.length() > 0);
}
+ /**
+ * Check dupl sofa name.
+ *
+ * @return the string
+ */
private String checkDuplSofaName() {
Capability[] cSets = capabilitySection.getCapabilities();
@@ -189,6 +229,13 @@ public class AddSofaDialog extends Abstr
return null;
}
+ /**
+ * Check dupl sofa name 1.
+ *
+ * @param name the name
+ * @param names the names
+ * @return true, if successful
+ */
private boolean checkDuplSofaName1(String name, String[] names) {
if (null == names)
return false;
@@ -199,6 +246,10 @@ public class AddSofaDialog extends Abstr
return false;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialogKeyVerify#verifyKeyChecks(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
public boolean verifyKeyChecks(VerifyEvent event) {
if (event.keyCode == SWT.CR || event.keyCode == SWT.TAB)
return true;