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 [9/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/uim...
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/HeaderPage.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/HeaderPage.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/HeaderPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/HeaderPage.java Sun Nov 13 16:13:16 2016
@@ -20,7 +20,6 @@
package org.apache.uima.taeconfigurator.editors.ui;
import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
-import org.apache.uima.taeconfigurator.TAEConfiguratorPlugin;
import org.apache.uima.taeconfigurator.editors.Form2Panel;
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.eclipse.swt.SWT;
@@ -37,48 +36,77 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.AbstractFormPart;
import org.eclipse.ui.forms.IFormPart;
import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.ManagedForm;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
+// TODO: Auto-generated Javadoc
/**
- * Common part of most pages
+ * Common part of most pages.
*/
public abstract class HeaderPage extends FormPage {
+ /** The Constant EQUAL_WIDTH. */
final public static boolean EQUAL_WIDTH = true;
+ /** The sash form. */
protected SashForm sashForm;
+ /** The editor. */
protected MultiPageEditor editor;
+ /** The toolkit. */
protected FormToolkit toolkit;
+ /** The left panel. */
protected Composite leftPanel;
+ /** The right panel. */
protected Composite rightPanel;
+ /** The sash form width. */
protected int sashFormWidth;
+ /** The left panel percent. */
protected float leftPanelPercent;
+ /** The right panel percent. */
protected float rightPanelPercent;
+ /** The left panel width. */
protected int leftPanelWidth;
+ /** The right panel width. */
protected int rightPanelWidth;
+ /**
+ * Instantiates a new header page.
+ *
+ * @param formEditor the form editor
+ * @param id the id
+ * @param keyPageTitle the key page title
+ */
public HeaderPage(MultiPageEditor formEditor, String id, String keyPageTitle) {
super(formEditor, id, keyPageTitle);
editor = formEditor;
toolkit = editor.getToolkit();
}
+ /**
+ * Instantiates a new header page.
+ *
+ * @param formEditor the form editor
+ * @param pageTitle the page title
+ */
public HeaderPage(MultiPageEditor formEditor, String pageTitle) {
this(formEditor, "UID_" + pageTitle, pageTitle);
}
+ /**
+ * Maybe initialize.
+ *
+ * @param managedForm the managed form
+ */
protected void maybeInitialize(IManagedForm managedForm) {
// if (TAEConfiguratorPlugin.is30version)
// ((ManagedForm) managedForm).initialize();
@@ -88,10 +116,22 @@ public abstract class HeaderPage extends
* General methods to create sub areas on pages
*/
+ /**
+ * New composite.
+ *
+ * @param parent the parent
+ * @return the composite
+ */
public Composite newComposite(Composite parent) {
return newnColumnSection(parent, 1);
}
+ /**
+ * New centered 2 span composite.
+ *
+ * @param parent the parent
+ * @return the composite
+ */
// this composite spans col 1 & 2, out of a 4 column (0, 1, 2, 3) grid layout
public Composite newCentered2SpanComposite(Composite parent) {
spacer(parent); // skip over col 0
@@ -100,6 +140,13 @@ public abstract class HeaderPage extends
return composite;
}
+ /**
+ * Newn column section.
+ *
+ * @param parent the parent
+ * @param cols the cols
+ * @return the composite
+ */
public Composite newnColumnSection(Composite parent, int cols) {
Composite section = toolkit.createComposite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -111,6 +158,12 @@ public abstract class HeaderPage extends
return section;
}
+ /**
+ * Setup 1 column layout.
+ *
+ * @param managedForm the managed form
+ * @return the composite
+ */
public Composite setup1ColumnLayout(IManagedForm managedForm) {
final ScrolledForm sform = managedForm.getForm();
final Composite form = sform.getBody();
@@ -126,6 +179,13 @@ public abstract class HeaderPage extends
return xtra;
}
+ /**
+ * Setup 2 column grid.
+ *
+ * @param managedForm the managed form
+ * @param equalWidth the equal width
+ * @return the composite
+ */
// this method creates no new composites.
public Composite setup2ColumnGrid(IManagedForm managedForm, boolean equalWidth) {
final ScrolledForm sform = managedForm.getForm();
@@ -136,6 +196,14 @@ public abstract class HeaderPage extends
return form;
}
+ /**
+ * Setup 2 column layout.
+ *
+ * @param managedForm the managed form
+ * @param w1 the w 1
+ * @param w2 the w 2
+ * @return the form 2 panel
+ */
public Form2Panel setup2ColumnLayout(IManagedForm managedForm, int w1, int w2) {
final ScrolledForm sform = managedForm.getForm();
final Composite form = sform.getBody();
@@ -163,6 +231,7 @@ public abstract class HeaderPage extends
rightPanelPercent = (float) w2 / (float) (w1 + w2);
rightPanel.addControlListener(new ControlAdapter() {
+ @Override
public void controlResized(ControlEvent e) {
setSashFormWidths();
}
@@ -171,6 +240,9 @@ public abstract class HeaderPage extends
return new Form2Panel(form, leftPanel, rightPanel);
}
+ /**
+ * Sets the sash form widths.
+ */
void setSashFormWidths() {
sashFormWidth = sashForm.getSize().x;
@@ -181,10 +253,11 @@ public abstract class HeaderPage extends
}
/**
- * Sash impl
- *
- * @param managedForm
- * @param equalWidth
+ * Sash impl.
+ *
+ * @param managedForm the managed form
+ * @param equalWidth the equal width
+ * @return the form 2 panel
*/
public Form2Panel setup2ColumnLayout(IManagedForm managedForm, boolean equalWidth) {
if (equalWidth)
@@ -194,6 +267,13 @@ public abstract class HeaderPage extends
return setup2ColumnLayout(managedForm, 60, 40);
}
+ /**
+ * Setup 2 column layout not sash.
+ *
+ * @param managedForm the managed form
+ * @param equalWidth the equal width
+ * @return the form 2 panel
+ */
public Form2Panel setup2ColumnLayoutNotSash(IManagedForm managedForm, boolean equalWidth) {
final ScrolledForm sform = managedForm.getForm();
final Composite form = sform.getBody();
@@ -214,6 +294,7 @@ public abstract class HeaderPage extends
// event (learned this by debugging)
sform.addListener(SWT.Resize, new Listener() {
+ @Override
public void handleEvent(Event event) {
float col1CurrentWidth = leftPanel.getSize().x;
float col2CurrentWidth = rightPanel.getSize().x;
@@ -227,6 +308,13 @@ public abstract class HeaderPage extends
return new Form2Panel(form, leftPanel, rightPanel);
}
+ /**
+ * Setup 2 column layout on 4 grid.
+ *
+ * @param managedForm the managed form
+ * @param equalWidth the equal width
+ * @return the form 2 panel
+ */
public Form2Panel setup2ColumnLayoutOn4Grid(IManagedForm managedForm, boolean equalWidth) {
Form2Panel f = setup2ColumnLayoutNotSash(managedForm, equalWidth);
((GridLayout) f.form.getLayout()).numColumns = 4;
@@ -235,10 +323,18 @@ public abstract class HeaderPage extends
return f;
}
+ /**
+ * Spacer.
+ *
+ * @param container the container
+ */
protected void spacer(Composite container) {
toolkit.createLabel(container, " ");
}
+ /**
+ * Mark stale.
+ */
public void markStale() {
if (getManagedForm() != null) {
IFormPart[] parts = getManagedForm().getParts();
@@ -252,46 +348,101 @@ public abstract class HeaderPage extends
// * Model Access
// **************************************************
+ /**
+ * Checks if is primitive.
+ *
+ * @return true, if is primitive
+ */
protected boolean isPrimitive() {
return editor.getAeDescription().isPrimitive();
}
+ /**
+ * Checks if is ae descriptor.
+ *
+ * @return true, if is ae descriptor
+ */
protected boolean isAeDescriptor() {
return editor.isAeDescriptor();
}
+ /**
+ * Checks if is type system descriptor.
+ *
+ * @return true, if is type system descriptor
+ */
public boolean isTypeSystemDescriptor() {
return editor.isTypeSystemDescriptor();
}
+ /**
+ * Checks if is index descriptor.
+ *
+ * @return true, if is index descriptor
+ */
public boolean isIndexDescriptor() {
return editor.isFsIndexCollection();
}
+ /**
+ * Checks if is type priority descriptor.
+ *
+ * @return true, if is type priority descriptor
+ */
public boolean isTypePriorityDescriptor() {
return editor.isTypePriorityDescriptor();
}
+ /**
+ * Checks if is ext res and bindings descriptor.
+ *
+ * @return true, if is ext res and bindings descriptor
+ */
public boolean isExtResAndBindingsDescriptor() {
return editor.isExtResAndBindingsDescriptor();
}
+ /**
+ * Checks if is collection reader descriptor.
+ *
+ * @return true, if is collection reader descriptor
+ */
public boolean isCollectionReaderDescriptor() {
return editor.isCollectionReaderDescriptor();
}
+ /**
+ * Checks if is cas initializer descriptor.
+ *
+ * @return true, if is cas initializer descriptor
+ */
public boolean isCasInitializerDescriptor() {
return editor.isCasInitializerDescriptor();
}
+ /**
+ * Checks if is cas consumer descriptor.
+ *
+ * @return true, if is cas consumer descriptor
+ */
public boolean isCasConsumerDescriptor() {
return editor.isCasConsumerDescriptor();
}
+ /**
+ * Checks if is local processing descriptor.
+ *
+ * @return true, if is local processing descriptor
+ */
public boolean isLocalProcessingDescriptor() {
return editor.isLocalProcessingDescriptor();
}
+ /**
+ * Gets the analysis engine meta data.
+ *
+ * @return the analysis engine meta data
+ */
protected AnalysisEngineMetaData getAnalysisEngineMetaData() {
return editor.getAeDescription().getAnalysisEngineMetaData();
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/HeaderPageWithSash.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/HeaderPageWithSash.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/HeaderPageWithSash.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/HeaderPageWithSash.java Sun Nov 13 16:13:16 2016
@@ -22,39 +22,54 @@ package org.apache.uima.taeconfigurator.
import org.apache.uima.taeconfigurator.TAEConfiguratorPlugin;
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
import org.eclipse.swt.SWT;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.ScrolledForm;
+// TODO: Auto-generated Javadoc
/**
+ * The Class HeaderPageWithSash.
*/
public class HeaderPageWithSash extends HeaderPage {
+ /** The haction. */
protected Action haction;
+ /** The vaction. */
protected Action vaction;
/**
- * @param formEditor
- * @param id
- * @param keyPageTitle
+ * Instantiates a new header page with sash.
+ *
+ * @param formEditor the form editor
+ * @param id the id
+ * @param keyPageTitle the key page title
*/
public HeaderPageWithSash(MultiPageEditor formEditor, String id, String keyPageTitle) {
super(formEditor, id, keyPageTitle);
}
/**
- * @param formEditor
- * @param pageTitle
+ * Instantiates a new header page with sash.
+ *
+ * @param formEditor the form editor
+ * @param pageTitle the page title
*/
public HeaderPageWithSash(MultiPageEditor formEditor, String pageTitle) {
super(formEditor, pageTitle);
}
+ /**
+ * Creates the tool bar actions.
+ *
+ * @param managedForm the managed form
+ */
protected void createToolBarActions(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
- haction = new Action("hor", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ haction = new Action("hor", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ @Override
public void run() {
sashForm.setOrientation(SWT.HORIZONTAL);
form.reflow(true);
@@ -68,7 +83,8 @@ public class HeaderPageWithSash extends
haction.setDisabledImageDescriptor(instance
.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
- vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ vaction = new Action("ver", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
+ @Override
public void run() {
sashForm.setOrientation(SWT.VERTICAL);
form.reflow(true);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ImportResBindSection.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/ImportResBindSection.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/ImportResBindSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ImportResBindSection.java Sun Nov 13 16:13:16 2016
@@ -24,12 +24,21 @@ import org.apache.uima.resource.metadata
import org.apache.uima.resource.metadata.impl.ResourceManagerConfiguration_impl;
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.apache.uima.util.InvalidXMLException;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Composite;
+// TODO: Auto-generated Javadoc
/**
+ * The Class ImportResBindSection.
*/
public class ImportResBindSection extends ImportSection {
+ /**
+ * Instantiates a new import res bind section.
+ *
+ * @param editor the editor
+ * @param parent the parent
+ */
public ImportResBindSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Imports for External Resources and Bindings",
"The following definitions are included:"); // or ! DESCRIPTION
@@ -37,32 +46,56 @@ public class ImportResBindSection extend
// **************************************
// * Code to support type import section
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#isAppropriate()
+ */
// **************************************
+ @Override
protected boolean isAppropriate() {
return true; // always show
}
/**
- * used when hovering
+ * used when hovering.
+ *
+ * @param source the source
+ * @return the description from import
*/
+ @Override
protected String getDescriptionFromImport(String source) {
return ""; // imports for resource bindings don't have descriptions
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#getModelImportArray()
+ */
+ @Override
protected Import[] getModelImportArray() {
return getResourceManagerConfiguration().getImports();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#setModelImportArray(org.apache.uima.resource.metadata.Import[])
+ */
+ @Override
protected void setModelImportArray(Import[] imports) {
getResourceManagerConfiguration().setImports(imports);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#clearModelBaseValue()
+ */
+ @Override
protected void clearModelBaseValue() {
getResourceManagerConfiguration().setExternalResourceBindings(externalResourceBinding0);
getResourceManagerConfiguration().setExternalResources(externalResourceDescription0);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#isValidImport(java.lang.String, java.lang.String)
+ */
// indexes are checked and merged when the CAS is built
+ @Override
protected boolean isValidImport(String title, String message) {
ResourceManagerConfiguration savedRmc = editor.getResolvedExternalResourcesAndBindings();
if (null != savedRmc)
@@ -71,7 +104,7 @@ public class ImportResBindSection extend
try {
editor.setResolvedExternalResourcesAndBindings();
} catch (InvalidXMLException e) {
- Utility.popMessage(title, message + editor.getMessagesToRootCause(e), Utility.ERROR);
+ Utility.popMessage(title, message + editor.getMessagesToRootCause(e), MessageDialog.ERROR);
revert(savedRmc);
return false;
}
@@ -82,6 +115,11 @@ public class ImportResBindSection extend
return true;
}
+ /**
+ * Revert.
+ *
+ * @param rmc the rmc
+ */
private void revert(ResourceManagerConfiguration rmc) {
getResourceManagerConfiguration()
.setExternalResourceBindings(rmc.getExternalResourceBindings());
@@ -89,10 +127,18 @@ public class ImportResBindSection extend
editor.setResolvedExternalResourcesAndBindings(rmc);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#finishImportChangeAction()
+ */
+ @Override
protected void finishImportChangeAction() {
editor.getResourcesPage().getResourceDependencySection().refresh(); // to change Binding flag
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#enable()
+ */
+ @Override
public void enable() {
super.enable();
addButton.setEnabled(true); // can add buttons even for aggregate
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ImportSection.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/ImportSection.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/ImportSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ImportSection.java Sun Nov 13 16:13:16 2016
@@ -47,52 +47,112 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
/**
- * Imports - used by aggregates types type priorities indexes external resource specifications
+ * Imports - used by aggregates types type priorities indexes external resource specifications.
*/
public abstract class ImportSection extends AbstractSection {
+ /**
+ * Gets the model import array.
+ *
+ * @return the model import array
+ */
protected abstract Import[] getModelImportArray();
+ /**
+ * Sets the model import array.
+ *
+ * @param newImports the new model import array
+ */
protected abstract void setModelImportArray(Import[] newImports);
+ /**
+ * Checks if is valid import.
+ *
+ * @param title the title
+ * @param message the message
+ * @return true, if is valid import
+ */
protected abstract boolean isValidImport(String title, String message);
+ /**
+ * Finish import change action.
+ */
protected abstract void finishImportChangeAction();
+ /**
+ * Gets the description from import.
+ *
+ * @param source the source
+ * @return the description from import
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
protected abstract String getDescriptionFromImport(String source) throws InvalidXMLException,
IOException;
+ /**
+ * Checks if is appropriate.
+ *
+ * @return true, if is appropriate
+ */
protected abstract boolean isAppropriate(); // if false, don't show section
+ /**
+ * Clear model base value.
+ */
protected abstract void clearModelBaseValue(); // used to clear exported value
+ /** The Constant TABLE_HOVER_REQUERY_TIME. */
protected static final long TABLE_HOVER_REQUERY_TIME = 15000;
+ /** The last table hover item. */
protected TableItem lastTableHoverItem = null;
+ /** The l last table hover millis. */
protected long lLastTableHoverMillis = -1;
+ /** The s last table hover help. */
protected String sLastTableHoverHelp = "";
+ /** The b disable tool tip help. */
protected boolean bDisableToolTipHelp = false;
+ /** The Constant TABLE_INDICATOR_BY_NAME. */
private static final String TABLE_INDICATOR_BY_NAME = "By Name";
+ /** The Constant TABLE_INDICATOR_BY_LOCATION. */
private static final String TABLE_INDICATOR_BY_LOCATION = "By Location";
+ /** The add button. */
protected Button addButton;
+ /** The remove button. */
private Button removeButton;
+ /** The set data path button. */
private Button setDataPathButton;
+ /** The import table. */
Table importTable;
+ /**
+ * Instantiates a new import section.
+ *
+ * @param aEditor the a editor
+ * @param parent the parent
+ * @param title the title
+ * @param description the description
+ */
public ImportSection(MultiPageEditor aEditor, Composite parent, String title, String description) {
super(aEditor, parent, title, description);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
@@ -125,6 +185,10 @@ public abstract class ImportSection exte
toolkit.paintBordersFor(sectionClient);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.AbstractFormPart#refresh()
+ */
+ @Override
public void refresh() {
super.refresh();
importTable.removeAll();
@@ -157,6 +221,7 @@ public abstract class ImportSection exte
*
* @see org.apache.uima.taeconfigurator.editors.ui.AbstractTableSection#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
if (event.widget == addButton) {
@@ -178,6 +243,9 @@ public abstract class ImportSection exte
}
}
+ /**
+ * Handle remove.
+ */
public void handleRemove() {
int nSelectedIndex = importTable.getSelectionIndex();
@@ -199,6 +267,9 @@ public abstract class ImportSection exte
setFileDirty();
}
+ /**
+ * Handle set data path.
+ */
private void handleSetDataPath() {
CommonInputDialog dialog = new CommonInputDialog(
this,
@@ -210,6 +281,9 @@ public abstract class ImportSection exte
CDEpropertyPage.setDataPath(editor.getProject(), dialog.getValue());
}
+ /**
+ * Handle add.
+ */
private void handleAdd() {
Shell shell = getSection().getShell();
MultiResourceSelectionDialog dialog = new MultiResourceSelectionDialog(shell, editor.getFile()
@@ -236,10 +310,9 @@ public abstract class ImportSection exte
/**
* Called with either byLocation non-null or byName non-null Adds multiple (by location) or one
- * (by name)
- *
- * @param locations
- * objects returned from dialog
+ * (by name).
+ *
+ * @param locations objects returned from dialog
* @param isByName true
* if imports should be done by name
* @return false if any import caused an error, true of all OK
@@ -274,6 +347,12 @@ public abstract class ImportSection exte
return true;
}
+ /**
+ * Already imported.
+ *
+ * @param imp the imp
+ * @return true, if successful
+ */
private boolean alreadyImported(Import imp) {
String currentFileBeingEdited = editor.getFile().getLocation().toString();
currentFileBeingEdited = editor.getDescriptorRelativePath(currentFileBeingEdited);
@@ -302,6 +381,10 @@ public abstract class ImportSection exte
return false;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#enable()
+ */
+ @Override
public void enable() {
int nSelectionIndex = importTable.getSelectionIndex();
boolean addEnable = (this instanceof TypeImportSection) ? (!isAggregate()) : true;
@@ -310,6 +393,11 @@ public abstract class ImportSection exte
removeButton.setEnabled(nSelectionIndex > -1);
}
+ /**
+ * Handle table context menu request.
+ *
+ * @param event the event
+ */
private void handleTableContextMenuRequest(Event event) {
TableItem item = importTable.getItem(new Point(event.x, event.y));
int nSelectedIndex = getIndex(item);
@@ -318,6 +406,11 @@ public abstract class ImportSection exte
bDisableToolTipHelp = false;
}
+ /**
+ * Handle table hover help.
+ *
+ * @param event the event
+ */
private void handleTableHoverHelp(Event event) {
TableItem item = importTable.getItem(new Point(event.x, event.y));
if (null != item) {
@@ -369,10 +462,10 @@ public abstract class ImportSection exte
}
/**
- *
- * @param xmlStartElement
- * first element exported
- * @param partTemplate
+ * Export importable part.
+ *
+ * @param xmlStartElement first element exported
+ * @param partTemplate the part template
*/
protected void exportImportablePart(String xmlStartElement, String partTemplate) {
String xmlEndElement = xmlStartElement.replaceFirst("<", "</");
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/IndexImportSection.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/IndexImportSection.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/IndexImportSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/IndexImportSection.java Sun Nov 13 16:13:16 2016
@@ -32,10 +32,18 @@ import org.apache.uima.util.InvalidXMLEx
import org.apache.uima.util.XMLInputSource;
import org.eclipse.swt.widgets.Composite;
+// TODO: Auto-generated Javadoc
/**
+ * The Class IndexImportSection.
*/
public class IndexImportSection extends ImportSection {
+ /**
+ * Instantiates a new index import section.
+ *
+ * @param editor the editor
+ * @param parent the parent
+ */
public IndexImportSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Index Imports",
"The following index definitions are included as part of this one."); // or !
@@ -44,35 +52,61 @@ public class IndexImportSection extends
// **************************************
// * Code to support type import section
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#isAppropriate()
+ */
// **************************************
+ @Override
protected boolean isAppropriate() {
return true; // always show
}
/**
- * used when hovering
+ * used when hovering.
+ *
+ * @param source the source
+ * @return the description from import
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
*/
+ @Override
protected String getDescriptionFromImport(String source) throws InvalidXMLException, IOException {
FsIndexCollection parsedImportItem = UIMAFramework.getXMLParser().parseFsIndexCollection(
new XMLInputSource(source));
return parsedImportItem.getDescription();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#getModelImportArray()
+ */
+ @Override
protected Import[] getModelImportArray() {
return getFsIndexCollection().getImports();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#setModelImportArray(org.apache.uima.resource.metadata.Import[])
+ */
+ @Override
protected void setModelImportArray(Import[] imports) {
if (imports == null)
throw new InternalErrorCDE("invalid state");
getFsIndexCollection().setImports(imports);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#clearModelBaseValue()
+ */
+ @Override
protected void clearModelBaseValue() {
getAnalysisEngineMetaData().setFsIndexes(fsIndexDescription0);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#isValidImport(java.lang.String, java.lang.String)
+ */
// indexes are checked and merged when the CAS is built
+ @Override
protected boolean isValidImport(String title, String message) {
FsIndexCollection savedIC = editor.getMergedFsIndexCollection();
@@ -91,6 +125,10 @@ public class IndexImportSection extends
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.ImportSection#finishImportChangeAction()
+ */
+ @Override
protected void finishImportChangeAction() {
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/IndexSection.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/IndexSection.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/IndexSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/IndexSection.java Sun Nov 13 16:13:16 2016
@@ -42,43 +42,72 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class IndexSection.
+ */
public class IndexSection extends AbstractSection {
+ /** The Constant ANNOTATION_INDEX_BUILT_IN. */
public static final String ANNOTATION_INDEX_BUILT_IN = "Annotation Index (Built-in)";
+ /** The Constant INDEX_NAME_COL. */
public final static int INDEX_NAME_COL = 0;
+ /** The Constant INDEX_TYPE_COL. */
public final static int INDEX_TYPE_COL = 1;
+ /** The Constant ASC_DES_COL. */
public final static int ASC_DES_COL = 1;
+ /** The Constant INDEX_KIND_COL. */
public final static int INDEX_KIND_COL = 2;
+ /** The tt. */
public TableTree tt; // accessed by inner class
+ /** The add index button. */
private Button addIndexButton;
+ /** The add key button. */
private Button addKeyButton;
+ /** 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 m built in index description. */
FsIndexDescription m_builtInIndexDescription = null;
+ /** The export button. */
private Button exportButton;
+ /** The index import section. */
private IndexImportSection indexImportSection;
+ /**
+ * Instantiates a new index section.
+ *
+ * @param editor the editor
+ * @param parent the parent
+ */
public IndexSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Indexes",
"The following indexes are defined on the type system for this engine.");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
@@ -115,6 +144,7 @@ public class IndexSection extends Abstra
*
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
if (null == indexImportSection)
indexImportSection = editor.getIndexesPage().getIndexImportSection();
@@ -135,6 +165,12 @@ public class IndexSection extends Abstra
enable();
}
+ /**
+ * Update index spec.
+ *
+ * @param item the item
+ * @param ndx the ndx
+ */
private void updateIndexSpec(TableTreeItem item, FsIndexDescription ndx) {
item.setText(INDEX_NAME_COL, ndx.getLabel());
item.setText(INDEX_TYPE_COL, formatName(ndx.getTypeName()));
@@ -148,6 +184,12 @@ public class IndexSection extends Abstra
}
}
+ /**
+ * Update key spec.
+ *
+ * @param item the item
+ * @param key the key
+ */
private void updateKeySpec(TableTreeItem item, FsIndexKeyDescription key) {
String name = key.getFeatureName();
item.setText(INDEX_NAME_COL, null == name ? "TYPE PRIORITY" : name);
@@ -156,10 +198,20 @@ public class IndexSection extends Abstra
item.setData(key);
}
+ /**
+ * Creates the fs index key description.
+ *
+ * @return the fs index key description
+ */
public FsIndexKeyDescription createFsIndexKeyDescription() {
return UIMAFramework.getResourceSpecifierFactory().createFsIndexKeyDescription();
}
+ /**
+ * Gets the built in index description.
+ *
+ * @return the built in index description
+ */
public FsIndexDescription getBuiltInIndexDescription() {
if (m_builtInIndexDescription == null) {
m_builtInIndexDescription = UIMAFramework.getResourceSpecifierFactory()
@@ -184,6 +236,12 @@ public class IndexSection extends Abstra
return m_builtInIndexDescription;
}
+ /**
+ * Not allowed.
+ *
+ * @param message the message
+ * @return true, if successful
+ */
private boolean notAllowed(String message) {
if (isIndexDescriptor() && !editor.getIsContextLoaded()) {
Utility
@@ -201,6 +259,7 @@ public class IndexSection extends Abstra
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
if (event.widget == addIndexButton) {
@@ -328,6 +387,12 @@ public class IndexSection extends Abstra
enable();
}
+ /**
+ * Fooling around with annotation index.
+ *
+ * @param item the item
+ * @return true, if successful
+ */
private boolean foolingAroundWithAnnotationIndex(TableTreeItem item) {
while (null != item.getParentItem())
item = item.getParentItem();
@@ -341,6 +406,12 @@ public class IndexSection extends Abstra
return false;
}
+ /**
+ * Adds the fs index key description.
+ *
+ * @param fsid the fsid
+ * @param key the key
+ */
public void addFsIndexKeyDescription(FsIndexDescription fsid, FsIndexKeyDescription key) {
FsIndexKeyDescription[] prevKeys = fsid.getKeys();
FsIndexKeyDescription[] newKeys = new FsIndexKeyDescription[prevKeys == null ? 1
@@ -351,6 +422,11 @@ public class IndexSection extends Abstra
fsid.setKeys(newKeys);
}
+ /**
+ * Adds the fs index description.
+ *
+ * @param fsid the fsid
+ */
public void addFsIndexDescription(FsIndexDescription fsid) {
FsIndexDescription[] oldFsIndexes = getAnalysisEngineMetaData().getFsIndexes();
FsIndexDescription[] newFsIndexes = new FsIndexDescription[oldFsIndexes == null ? 1
@@ -361,17 +437,34 @@ public class IndexSection extends Abstra
getAnalysisEngineMetaData().setFsIndexes(newFsIndexes);
}
+ /**
+ * Removes the fs index description.
+ *
+ * @param fsid the fsid
+ */
public void removeFsIndexDescription(FsIndexDescription fsid) {
getAnalysisEngineMetaData().setFsIndexes(
(FsIndexDescription[]) Utility.removeElementFromArray(getAnalysisEngineMetaData()
.getFsIndexes(), fsid, FsIndexDescription.class));
}
+ /**
+ * Removes the fs index key description.
+ *
+ * @param fsid the fsid
+ * @param key the key
+ */
public void removeFsIndexKeyDescription(FsIndexDescription fsid, FsIndexKeyDescription key) {
fsid.setKeys((FsIndexKeyDescription[]) Utility.removeElementFromArray(fsid.getKeys(), key,
FsIndexKeyDescription.class));
}
+ /**
+ * Gets the already used features.
+ *
+ * @param ndx the ndx
+ * @return the already used features
+ */
public List getAlreadyUsedFeatures(FsIndexDescription ndx) {
List result = new ArrayList();
FsIndexKeyDescription[] items = ndx.getKeys();
@@ -383,6 +476,13 @@ public class IndexSection extends Abstra
return result;
}
+ /**
+ * Adds the or edit index key.
+ *
+ * @param dialog the dialog
+ * @param key the key
+ * @return the fs index key description
+ */
public FsIndexKeyDescription addOrEditIndexKey(AddIndexKeyDialog dialog, FsIndexKeyDescription key) {
if (dialog.open() == Window.CANCEL) {
return null;
@@ -401,9 +501,10 @@ public class IndexSection extends Abstra
}
/**
- * This has to check the resolvedImports, mergedWithDelegates version of the fsindexes
- *
- * @param indexLabel
+ * This has to check the resolvedImports, mergedWithDelegates version of the fsindexes.
+ *
+ * @param indexLabel the index label
+ * @return true, if is duplicate index label
*/
public boolean isDuplicateIndexLabel(String indexLabel) {
FsIndexDescription[] indexes = getAnalysisEngineMetaData().getFsIndexes();
@@ -418,6 +519,10 @@ public class IndexSection extends Abstra
return false;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#enable()
+ */
+ @Override
public void enable() {
boolean selected = tt.getSelectionCount() == 1;
TableTreeItem item = null;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/IndexesPage.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/IndexesPage.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/IndexesPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/IndexesPage.java Sun Nov 13 16:13:16 2016
@@ -23,25 +23,39 @@ import org.apache.uima.taeconfigurator.e
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
/**
+ * The Class IndexesPage.
*/
public class IndexesPage extends HeaderPageWithSash {
+ /** The index section. */
private IndexSection indexSection;
+ /** The index import section. */
private IndexImportSection indexImportSection;
+ /** The type priority import section. */
private TypePriorityImportSection typePriorityImportSection;
+ /** The priority list section. */
private PriorityListSection priorityListSection;
+ /**
+ * Instantiates a new indexes page.
+ *
+ * @param editor the editor
+ */
public IndexesPage(MultiPageEditor editor) {
super(editor, "Indexes");
}
/**
* Called by the 3.0 framework to fill in the contents
+ *
+ * @param managedForm the managed form
*/
+ @Override
protected void createFormContent(IManagedForm managedForm) {
final Form2Panel form2Panel = setup2ColumnLayout(managedForm, EQUAL_WIDTH);
@@ -59,18 +73,38 @@ public class IndexesPage extends HeaderP
createToolBarActions(managedForm);
}
+ /**
+ * Gets the index section.
+ *
+ * @return the index section
+ */
public IndexSection getIndexSection() {
return indexSection;
}
+ /**
+ * Gets the priority list section.
+ *
+ * @return the priority list section
+ */
public PriorityListSection getPriorityListSection() {
return priorityListSection;
}
+ /**
+ * Gets the index import section.
+ *
+ * @return the index import section
+ */
public IndexImportSection getIndexImportSection() {
return indexImportSection;
}
+ /**
+ * Gets the type priority import section.
+ *
+ * @return the type priority import section
+ */
public TypePriorityImportSection getTypePriorityImportSection() {
return typePriorityImportSection;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/MetaDataSection.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/MetaDataSection.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/MetaDataSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/MetaDataSection.java Sun Nov 13 16:13:16 2016
@@ -27,33 +27,50 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class MetaDataSection.
+ */
public class MetaDataSection extends AbstractSection {
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#enable()
+ */
+ @Override
public void enable() {
}
+ /** The name text. */
private Text nameText;
+ /** The description text. */
private Text descriptionText;
+ /** The version text. */
private Text versionText;
+ /** The vendor text. */
private Text vendorText;
+ /** The dmd. */
private DescriptorMetaData dmd = null;
/**
* Creates a section to enter meta data. Including a text field for name, description, version and
* vendor.
- *
- * @param editor
- * the referenced multipage editor
+ *
+ * @param editor the referenced multipage editor
+ * @param parent the parent
*/
public MetaDataSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Overall Identification Information",
"This section specifies the basic identification information for this descriptor");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
Composite sectionClient = new2ColumnComposite(this.getSection());
@@ -74,6 +91,7 @@ public class MetaDataSection extends Abs
*
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
if (null == dmd)
dmd = new DescriptorMetaData(editor);
@@ -99,6 +117,7 @@ public class MetaDataSection extends Abs
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
valueChanged = false;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/OverviewPage.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/OverviewPage.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/OverviewPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/OverviewPage.java Sun Nov 13 16:13:16 2016
@@ -25,14 +25,23 @@ import org.eclipse.swt.SWT;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class OverviewPage.
+ */
public class OverviewPage extends HeaderPageWithSash {
+ /** The primitive section. */
private PrimitiveSection primitiveSection;
+ /** The metadata section. */
// should always exist
private MetaDataSection metadataSection;
/**
+ * Instantiates a new overview page.
+ *
+ * @param aEditor the a editor
*/
public OverviewPage(MultiPageEditor aEditor) {
super(aEditor, "UID_OverviewPage", "Overview");
@@ -40,7 +49,10 @@ public class OverviewPage extends Header
/**
* Called by the 3.0 framework to fill in the contents
+ *
+ * @param managedForm the managed form
*/
+ @Override
protected void createFormContent(IManagedForm managedForm) {
final Form2Panel form = setup2ColumnLayout(managedForm, EQUAL_WIDTH);
managedForm.getForm().setText("Overview");
@@ -61,10 +73,20 @@ public class OverviewPage extends Header
}
}
+ /**
+ * Gets the primitive section.
+ *
+ * @return the primitive section
+ */
public PrimitiveSection getPrimitiveSection() {
return primitiveSection;
}
+ /**
+ * Gets the meta data section.
+ *
+ * @return the meta data section
+ */
public MetaDataSection getMetaDataSection() {
return metadataSection;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterDelegatesSection.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/ParameterDelegatesSection.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/ParameterDelegatesSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterDelegatesSection.java Sun Nov 13 16:13:16 2016
@@ -45,18 +45,33 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ParameterDelegatesSection.
+ */
public class ParameterDelegatesSection extends AbstractSectionParm {
+ /** The section client. */
private Composite sectionClient;
+ /** The parm section. */
private ParameterSection parmSection;
+ /** The create non shared override. */
private boolean createNonSharedOverride;
+ /** The create override button. */
private Button createOverrideButton;
+ /** The create non shared override button. */
private Button createNonSharedOverrideButton;
+ /**
+ * Instantiates a new parameter delegates section.
+ *
+ * @param editor the editor
+ * @param parent the parent
+ */
public ParameterDelegatesSection(MultiPageEditor editor, Composite parent) {
super(
editor,
@@ -71,6 +86,7 @@ public class ParameterDelegatesSection e
*
* @see org.eclipse.ui.forms.IFormPart#initialize(org.eclipse.ui.forms.IManagedForm)
*/
+ @Override
public void initialize(IManagedForm form) {
parmSection = editor.getParameterPage().getParameterSection();
@@ -98,6 +114,7 @@ public class ParameterDelegatesSection e
*
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
super.refresh();
parmSection = editor.getParameterPage().getParameterSection();
@@ -128,6 +145,11 @@ public class ParameterDelegatesSection e
enable();
}
+ /**
+ * Adds the delegate to GUI.
+ *
+ * @param entry the entry
+ */
private void addDelegateToGUI(Map.Entry entry) {
addDelegateToGUI((String) entry.getKey(), (ResourceSpecifier) entry.getValue());
// String key = (String) entry.getKey();
@@ -142,6 +164,12 @@ public class ParameterDelegatesSection e
// }
}
+ /**
+ * Adds the delegate to GUI.
+ *
+ * @param key the key
+ * @param delegate the delegate
+ */
private void addDelegateToGUI(String key, ResourceSpecifier delegate) {
if (delegate instanceof AnalysisEngineDescription || delegate instanceof CasConsumerDescription
|| delegate instanceof FlowControllerDescription) {
@@ -155,6 +183,12 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Adds the delegate groups to GUI.
+ *
+ * @param parent the parent
+ * @param delegate the delegate
+ */
private void addDelegateGroupsToGUI(TreeItem parent, ResourceCreationSpecifier delegate) {
ConfigurationParameterDeclarations cpd1 = delegate.getMetaData()
.getConfigurationParameterDeclarations();
@@ -180,6 +214,12 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Adds the delegate group to GUI.
+ *
+ * @param parent the parent
+ * @param cg the cg
+ */
private void addDelegateGroupToGUI(TreeItem parent, ConfigGroup cg) {
ConfigurationParameter[] cps = cg.getConfigParms();
if (null != cps && cps.length > 0) {
@@ -191,6 +231,12 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Adds the delegate parms to GUI.
+ *
+ * @param parent the parent
+ * @param cps the cps
+ */
private void addDelegateParmsToGUI(TreeItem parent, ConfigurationParameter[] cps) {
if (null != cps) {
for (int i = 0; i < cps.length; i++) {
@@ -206,6 +252,12 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Adds the delegate parm overrides to GUI.
+ *
+ * @param parent the parent
+ * @param overrides the overrides
+ */
private void addDelegateParmOverridesToGUI(TreeItem parent, String[] overrides) {
for (int i = 0; i < overrides.length; i++) {
TreeItem d = new TreeItem(parent, SWT.NONE);
@@ -218,6 +270,7 @@ public class ParameterDelegatesSection e
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
if (event.type == SWT.MouseHover) {
showDescriptionAsToolTip(event);
@@ -230,6 +283,11 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Adds the overrides.
+ *
+ * @param nonShared the non shared
+ */
private void addOverrides(boolean nonShared) {
TreeItem item = tree.getSelection()[0];
createNonSharedOverride = nonShared;
@@ -241,35 +299,75 @@ public class ParameterDelegatesSection e
addAllGroups(item.getItems());
}
+ /**
+ * Gets the configuration parameter from tree item.
+ *
+ * @param item the item
+ * @return the configuration parameter from tree item
+ */
public ConfigurationParameter getConfigurationParameterFromTreeItem(TreeItem item) {
return (ConfigurationParameter) item.getData();
}
+ /**
+ * Gets the config group from tree item.
+ *
+ * @param item the item
+ * @return the config group from tree item
+ */
public ConfigGroup getConfigGroupFromTreeItem(TreeItem item) {
return (ConfigGroup) item.getData();
}
+ /**
+ * Gets the key name from tree item.
+ *
+ * @param item the item
+ * @return the key name from tree item
+ */
private String getKeyNameFromTreeItem(TreeItem item) {
return (String) item.getData();
}
+ /**
+ * Adds the new parameter.
+ *
+ * @param item the item
+ */
private void addNewParameter(TreeItem item) {
addNewParameter(getConfigurationParameterFromTreeItem(item), getConfigGroupFromTreeItem(item
.getParentItem()), getKeyNameFromTreeItem(item.getParentItem().getParentItem()));
}
+ /**
+ * Adds the all parameters.
+ *
+ * @param items the items
+ */
private void addAllParameters(TreeItem[] items) {
for (int i = 0; i < items.length; i++) {
addNewParameter(items[i]);
}
}
+ /**
+ * Adds the all groups.
+ *
+ * @param items the items
+ */
private void addAllGroups(TreeItem[] items) {
for (int i = 0; i < items.length; i++) {
addAllParameters(items[i].getItems());
}
}
+ /**
+ * Adds the new parameter.
+ *
+ * @param parm the parm
+ * @param delegateGroup the delegate group
+ * @param key the key
+ */
private void addNewParameter(ConfigurationParameter parm, ConfigGroup delegateGroup, String key) {
ConfigGroup group = getCorrespondingModelGroup(delegateGroup);
@@ -306,6 +404,13 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Gets the overriding parm name.
+ *
+ * @param override the override
+ * @param cgset the cgset
+ * @return the overriding parm name
+ */
/*
* Check if already have an override for this delegate parameter
* If parameter is in a group-set with multiple groups, check if override is in
@@ -339,6 +444,13 @@ public class ParameterDelegatesSection e
return null;
}
+ /**
+ * Gets the overriding parm name.
+ *
+ * @param override the override
+ * @param cps the cps
+ * @return the overriding parm name
+ */
private static String getOverridingParmName(String override, ConfigurationParameter[] cps) {
if (null != cps)
for (int i = 0; i < cps.length; i++) {
@@ -353,9 +465,9 @@ public class ParameterDelegatesSection e
}
/**
- * Add a suffix to the name to make it unique within all parameters defined for the cpd
- *
- * @param name
+ * Add a suffix to the name to make it unique within all parameters defined for the cpd.
+ *
+ * @param name the name
* @return name with suffix making it unique
*/
private String generateUniqueName(String name) {
@@ -375,6 +487,12 @@ public class ParameterDelegatesSection e
return nameTry;
}
+ /**
+ * Adds the parm names.
+ *
+ * @param list the list
+ * @param parms the parms
+ */
private void addParmNames(List list, ConfigurationParameter[] parms) {
if (null != parms) {
for (int i = 0; i < parms.length; i++) {
@@ -383,6 +501,13 @@ public class ParameterDelegatesSection e
}
}
+ /**
+ * Gets the override index.
+ *
+ * @param parm the parm
+ * @param override the override
+ * @return the override index
+ */
private int getOverrideIndex(ConfigurationParameter parm, String override) {
String[] overrides = parm.getOverrides();
if (null == overrides)
@@ -394,6 +519,13 @@ public class ParameterDelegatesSection e
return -1;
}
+ /**
+ * Gets the same named parm in group.
+ *
+ * @param parm the parm
+ * @param group the group
+ * @return the same named parm in group
+ */
private ConfigurationParameter getSameNamedParmInGroup(ConfigurationParameter parm,
ConfigGroup group) {
ConfigurationParameter[] cps = group.getConfigParms();
@@ -405,6 +537,13 @@ public class ParameterDelegatesSection e
return null;
}
+ /**
+ * Parm spec matches.
+ *
+ * @param p the p
+ * @param q the q
+ * @return true, if successful
+ */
private boolean parmSpecMatches(ConfigurationParameter p, ConfigurationParameter q) {
if (!p.getType().equals(q.getType()))
return false;
@@ -415,6 +554,12 @@ public class ParameterDelegatesSection e
return true;
}
+ /**
+ * Gets the corresponding model group.
+ *
+ * @param delegateGroup the delegate group
+ * @return the corresponding model group
+ */
private ConfigGroup getCorrespondingModelGroup(ConfigGroup delegateGroup) {
switch (delegateGroup.getKind()) {
case ConfigGroup.NOT_IN_ANY_GROUP:
@@ -427,6 +572,12 @@ public class ParameterDelegatesSection e
throw new InternalErrorCDE("invalid state");
}
+ /**
+ * Gets the corresponding model group.
+ *
+ * @param nameArray the name array
+ * @return the corresponding model group
+ */
private ConfigGroup getCorrespondingModelGroup(String[] nameArray) {
ConfigurationGroup[] cgs = cpd.getConfigurationGroups();
for (int i = 0; i < cgs.length; i++) {
@@ -438,10 +589,11 @@ public class ParameterDelegatesSection e
}
/**
- * Compare for set equals, assuming sets have no duplicates
- *
- * @param a
- * @param b
+ * Compare for set equals, assuming sets have no duplicates.
+ *
+ * @param a the a
+ * @param b the b
+ * @return true, if successful
*/
private boolean setEquals(Object[] a, Object[] b) {
if (null == a && null == b)
@@ -464,6 +616,10 @@ public class ParameterDelegatesSection e
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSectionParm#enable()
+ */
+ @Override
public void enable() {
createOverrideButton.setEnabled(tree.getSelectionCount() == 1);
createNonSharedOverrideButton.setEnabled(tree.getSelectionCount() == 1);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterPage.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/ParameterPage.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/ParameterPage.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterPage.java Sun Nov 13 16:13:16 2016
@@ -23,19 +23,33 @@ import org.apache.uima.taeconfigurator.e
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ParameterPage.
+ */
public class ParameterPage extends HeaderPageWithSash {
+ /** The parameter section. */
private ParameterSection parameterSection;
+ /** The parameter delegates section. */
private ParameterDelegatesSection parameterDelegatesSection;
+ /**
+ * Instantiates a new parameter page.
+ *
+ * @param editor the editor
+ */
public ParameterPage(MultiPageEditor editor) {
super(editor, "Configuration Parameters");
}
/**
- * Called by the framework to fill in the contents
+ * Called by the framework to fill in the contents.
+ *
+ * @param managedForm the managed form
*/
+ @Override
protected void createFormContent(IManagedForm managedForm) {
managedForm.getForm().setText("Parameter Definitions");
Form2Panel form2Panel = setup2ColumnLayout(managedForm, 55, 45);
@@ -45,10 +59,20 @@ public class ParameterPage extends Heade
createToolBarActions(managedForm);
}
+ /**
+ * Gets the parameter delegates section.
+ *
+ * @return the parameter delegates section
+ */
public ParameterDelegatesSection getParameterDelegatesSection() {
return parameterDelegatesSection;
}
+ /**
+ * Gets the parameter section.
+ *
+ * @return the parameter section
+ */
public ParameterSection getParameterSection() {
return parameterSection;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterSection.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/ParameterSection.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/ParameterSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterSection.java Sun Nov 13 16:13:16 2016
@@ -141,39 +141,53 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ParameterSection.
+ */
public class ParameterSection extends AbstractSectionParm {
+ /** The Constant NEW_OVERRIDE. */
public final static int NEW_OVERRIDE = -1;
+ /** The Constant REMOVE_FROM_GUI. */
public final static boolean REMOVE_FROM_GUI = true;
+ /** The Constant GIVE_WARNING_MESSAGE. */
public final static boolean GIVE_WARNING_MESSAGE = true;
+ /** The default group. */
private Text defaultGroup;
+ /** The search strategy. */
private CCombo searchStrategy;
+ /** The add button. */
private Button addButton;
+ /** The add group button. */
private Button addGroupButton;
+ /** The edit button. */
private Button editButton;
+ /** The remove button. */
private Button removeButton;
+ /** The using groups button. */
private Button usingGroupsButton;
+ /** The grouping control. */
private Composite groupingControl;
+ /** The first time. */
private boolean firstTime = true;
/**
- * Creates a section to show a list of all parameters
- *
- * @param editor
- * backpointer to the main multipage editor
- * @param parent
- * the Composite where this section lives
+ * Creates a section to show a list of all parameters.
+ *
+ * @param editor backpointer to the main multipage editor
+ * @param parent the Composite where this section lives
*/
public ParameterSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Configuration Parameters",
@@ -202,6 +216,10 @@ public class ParameterSection extends Ab
// both incrementally updated, so rebuild is not needed. This preserves
// user-specified expansion of nodes.
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
@@ -255,6 +273,7 @@ public class ParameterSection extends Ab
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
super.refresh(); // clears stale and dirty bits in AbstractFormPart
// superclass
@@ -298,6 +317,7 @@ public class ParameterSection extends Ab
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
cpd = getAnalysisEngineMetaData().getConfigurationParameterDeclarations();
@@ -462,6 +482,12 @@ public class ParameterSection extends Ab
enable();
}
+ /**
+ * Adds the or edit override.
+ *
+ * @param parmItem the parm item
+ * @param overrideIndex the override index
+ */
private void addOrEditOverride(TreeItem parmItem, int overrideIndex) {
ConfigurationParameter cp = getCorrespondingModelParm(parmItem);
TreeItem groupItem = parmItem.getParentItem();
@@ -510,6 +536,13 @@ public class ParameterSection extends Ab
}
+ /**
+ * Removes the items.
+ *
+ * @param itemsToRemove the items to remove
+ * @param giveWarningMsg the give warning msg
+ * @return true, if successful
+ */
private boolean removeItems(TreeItem[] itemsToRemove, boolean giveWarningMsg) {
String[] namesToRemove = new String[itemsToRemove.length];
boolean[] isGroup = new boolean[itemsToRemove.length];
@@ -579,6 +612,12 @@ public class ParameterSection extends Ab
return true;
}
+ /**
+ * Removes the parameter.
+ *
+ * @param itemToRemove the item to remove
+ * @param nameToRemove the name to remove
+ */
private void removeParameter(TreeItem itemToRemove, String nameToRemove) {
TreeItem parentItem = itemToRemove.getParentItem();
ConfigurationGroup cg = null;
@@ -603,6 +642,12 @@ public class ParameterSection extends Ab
}
}
+ /**
+ * Removes the group.
+ *
+ * @param itemToRemove the item to remove
+ * @param nameToRemove the name to remove
+ */
private void removeGroup(TreeItem itemToRemove, String nameToRemove) {
if (nameToRemove.equals(COMMON_GROUP)) {
removeCommonParmSettingsFromMultipleGroups();
@@ -631,6 +676,14 @@ public class ParameterSection extends Ab
}
}
+ /**
+ * Adds the parm.
+ *
+ * @param name the name
+ * @param modelParm the model parm
+ * @param group the group
+ * @param override the override
+ */
public void addParm(String name, ConfigurationParameter modelParm, ConfigGroup group,
String override) {
TreeItem parentGroup = getTreeItemGroup(group);
@@ -647,6 +700,12 @@ public class ParameterSection extends Ab
commonActionFinish();
}
+ /**
+ * Gets the configuration group.
+ *
+ * @param groupName the group name
+ * @return the configuration group
+ */
private ConfigurationGroup getConfigurationGroup(String groupName) {
if (groupName.equals(COMMON_GROUP))
throw new InternalErrorCDE("invalid call");
@@ -658,12 +717,26 @@ public class ParameterSection extends Ab
throw new InternalErrorCDE("invalid state");
}
+ /**
+ * Removes the configuration group.
+ *
+ * @param groups the groups
+ * @param cg the cg
+ * @return the configuration group[]
+ */
private ConfigurationGroup[] removeConfigurationGroup(ConfigurationGroup[] groups,
ConfigurationGroup cg) {
return (ConfigurationGroup[]) Utility.removeElementFromArray(groups, cg,
ConfigurationGroup.class);
}
+ /**
+ * Removes the configuration parameter.
+ *
+ * @param parms the parms
+ * @param nameToRemove the name to remove
+ * @return the configuration parameter[]
+ */
private ConfigurationParameter[] removeConfigurationParameter(ConfigurationParameter[] parms,
String nameToRemove) {
ConfigurationParameter[] newParms = new ConfigurationParameter[parms.length - 1];
@@ -675,6 +748,13 @@ public class ParameterSection extends Ab
return newParms;
}
+ /**
+ * Removes the override.
+ *
+ * @param cp the cp
+ * @param i the i
+ * @return the string[]
+ */
private String[] removeOverride(ConfigurationParameter cp, int i) {
String[] oldOverrides = cp.getOverrides();
String[] newOverrides = new String[oldOverrides.length - 1];
@@ -686,10 +766,10 @@ public class ParameterSection extends Ab
}
/**
- * Called to add group to aggregate parm decl based on delegate group
- *
- * @param group
- * the delegate group needing to be added to the aggregate
+ * Called to add group to aggregate parm decl based on delegate group.
+ *
+ * @param group the delegate group needing to be added to the aggregate
+ * @return the config group
*/
public ConfigGroup addGroup(ConfigGroup group) {
String groupName = group.getName();
@@ -710,10 +790,13 @@ public class ParameterSection extends Ab
// existing, if not null, doesn't point to <Common> which can't be edited
/**
+ * Adds the new or edit existing group.
+ *
* @param names -
* a sequence of group names separated by blanks
* @param existing -
* null or an existing tree item being edited
+ * @return true, if successful
*/
private boolean addNewOrEditExistingGroup(String names, TreeItem existing) {
valueChanged = true; // preset
@@ -779,6 +862,12 @@ public class ParameterSection extends Ab
return true;
}
+ /**
+ * Fill in front of common.
+ *
+ * @param parms the parms
+ * @param settingsTreeGroup the settings tree group
+ */
private void fillInFrontOfCommon(ConfigurationParameter[] parms, TreeItem settingsTreeGroup) {
if (parms != null) {
for (int i = parms.length - 1; i >= 0; i--) {
@@ -788,10 +877,10 @@ public class ParameterSection extends Ab
}
/**
- * Calculate s1 - s2 set
- *
- * @param s1
- * @param s2
+ * Calculate s1 - s2 set.
+ *
+ * @param s1 the s 1
+ * @param s2 the s 2
* @return s1 - s2 set
*/
private String[] setDiff(String[] s1, String[] s2) {
@@ -803,6 +892,13 @@ public class ParameterSection extends Ab
return (String[]) result.toArray(stringArray0);
}
+ /**
+ * Sets the equal.
+ *
+ * @param s1 the s 1
+ * @param s2 the s 2
+ * @return true, if successful
+ */
private boolean setEqual(String[] s1, String[] s2) {
if (null == s1 && null == s2)
return true;
@@ -816,20 +912,20 @@ public class ParameterSection extends Ab
}
/**
- * Called from ParameterDelegatesSection to add an override
- *
- * @param parmInGroup
- * @param override
+ * Called from ParameterDelegatesSection to add an override.
+ *
+ * @param parmInGroup the parm in group
+ * @param override the override
*/
public void addOverride(ConfigurationParameter parmInGroup, String override) {
addOverride(override, getTreeItemParm(parmInGroup), parmInGroup);
}
/**
- * add an override item
- *
- * @param parent
- * @param override
+ * add an override item.
+ *
+ * @param parent the parent
+ * @param override the override
*/
private void addOverrideToGUI(TreeItem parent, String override) {
// addOverride(dialog.overrideSpec, parent, cp);
@@ -839,11 +935,12 @@ public class ParameterSection extends Ab
/**
* Called by addNewConfigurationParameter, and fill (via refresh) to add overrides to the tree
- * list
- *
- * @param parent
- * @param modelCP
+ * list.
+ *
+ * @param parent the parent
+ * @param modelCP the model CP
*/
+ @Override
protected void fillOverrides(TreeItem parent, ConfigurationParameter modelCP) {
if (isAggregate()) {
String[] overrides = modelCP.getOverrides();
@@ -857,11 +954,11 @@ public class ParameterSection extends Ab
}
/**
- * called from add Override action
- *
- * @param dialog
- * @param parent
- * @param cp
+ * called from add Override action.
+ *
+ * @param override the override
+ * @param parent the parent
+ * @param cp the cp
*/
private void addOverride(String override, TreeItem parent, ConfigurationParameter cp) {
cp.setOverrides(addOverrideToArray(cp.getOverrides(), override));
@@ -870,6 +967,12 @@ public class ParameterSection extends Ab
commonActionFinish();
}
+ /**
+ * Alter existing configuration parameter.
+ *
+ * @param dialog the dialog
+ * @param existingTreeItem the existing tree item
+ */
private void alterExistingConfigurationParameter(AddParameterDialog dialog,
TreeItem existingTreeItem) {
ConfigurationParameter existingCP = getCorrespondingModelParm(existingTreeItem);
@@ -895,6 +998,13 @@ public class ParameterSection extends Ab
commonParmUpdate(existingTreeItem, existingCP, previousCP.getName());
}
+ /**
+ * Common parm update.
+ *
+ * @param existingTreeItem the existing tree item
+ * @param existingCP the existing CP
+ * @param prevName the prev name
+ */
private void commonParmUpdate(TreeItem existingTreeItem, ConfigurationParameter existingCP,
String prevName) {
updateParmInSettingsGUI(existingCP, existingTreeItem, prevName);
@@ -922,9 +1032,9 @@ public class ParameterSection extends Ab
/**
* Fills in the model Configuration Parm from the Add/Edit dialog. called from
* addNewConfigurationParameter, and alterExistingConfigurationParameter
- *
- * @param dialog
- * @param existingCP
+ *
+ * @param dialog the dialog
+ * @param existingCP the existing CP
*/
private void fillModelParm(AddParameterDialog dialog, ConfigurationParameter existingCP) {
valueChanged = false;
@@ -942,10 +1052,11 @@ public class ParameterSection extends Ab
/**
* Called from UI when adding a new Configuraton Parameter Called from refresh when filling params
- * Called when adding override to new parm
- *
- * @param dialog
- * @param group
+ * Called when adding override to new parm.
+ *
+ * @param dialog the dialog
+ * @param group the group
+ * @return the configuration parameter
*/
private ConfigurationParameter addNewConfigurationParameter(AddParameterDialog dialog,
TreeItem group) {
@@ -969,6 +1080,11 @@ public class ParameterSection extends Ab
return newCP;
}
+ /**
+ * Adds the group to model.
+ *
+ * @param newCg the new cg
+ */
private void addGroupToModel(ConfigurationGroup newCg) {
ConfigurationGroup[] oldCgs = cpd.getConfigurationGroups();
ConfigurationGroup[] newCgs;
@@ -982,6 +1098,13 @@ public class ParameterSection extends Ab
cpd.setConfigurationGroups(newCgs);
}
+ /**
+ * Adds the override to array.
+ *
+ * @param overrides the overrides
+ * @param newOverride the new override
+ * @return the string[]
+ */
private String[] addOverrideToArray(String[] overrides, String newOverride) {
if (null == overrides)
return new String[] { newOverride };
@@ -991,6 +1114,13 @@ public class ParameterSection extends Ab
return newOverrides;
}
+ /**
+ * Adds the parm to array.
+ *
+ * @param cps the cps
+ * @param newCP the new CP
+ * @return the configuration parameter[]
+ */
private ConfigurationParameter[] addParmToArray(ConfigurationParameter[] cps,
ConfigurationParameter newCP) {
@@ -1004,8 +1134,9 @@ public class ParameterSection extends Ab
}
/**
- *
- * @param names
+ * Group name already defined.
+ *
+ * @param names the names
* @return true if there is a group whose names are the same set
*/
private boolean groupNameAlreadyDefined(String[] names) {
@@ -1019,6 +1150,13 @@ public class ParameterSection extends Ab
return false;
}
+ /**
+ * Parameter name already defined no msg.
+ *
+ * @param name the name
+ * @param pCpd the cpd
+ * @return true, if successful
+ */
public static boolean parameterNameAlreadyDefinedNoMsg(String name,
ConfigurationParameterDeclarations pCpd) {
if (pCpd.getCommonParameters() != null) {
@@ -1048,6 +1186,7 @@ public class ParameterSection extends Ab
*
* @param name - Parameter name
* @param cgset - Group-set (may be not-in-any, common, or a named set)
+ * @return true, if successful
*/
public boolean parameterNameAlreadyDefinedNoMsg(String name, ConfigGroup cgset) {
if (cgset.getKind() == ConfigGroup.NOT_IN_ANY_GROUP) {
@@ -1069,6 +1208,13 @@ public class ParameterSection extends Ab
return false;
}
+ /**
+ * Have shared group.
+ *
+ * @param set1 the set 1
+ * @param set2 the set 2
+ * @return true, if successful
+ */
/*
* Check if arrays have an element in common
*/
@@ -1083,6 +1229,13 @@ public class ParameterSection extends Ab
return false;
}
+ /**
+ * Parameter name already defined.
+ *
+ * @param name the name
+ * @param cgset the cgset
+ * @return true, if successful
+ */
public boolean parameterNameAlreadyDefined(String name, ConfigGroup cgset) {
boolean alreadyDefined = parameterNameAlreadyDefinedNoMsg(name, cgset);
if (alreadyDefined) {
@@ -1095,6 +1248,13 @@ public class ParameterSection extends Ab
return alreadyDefined;
}
+ /**
+ * Parameter in array.
+ *
+ * @param name the name
+ * @param cps the cps
+ * @return true, if successful
+ */
private static boolean parameterInArray(String name, ConfigurationParameter[] cps) {
for (int i = 0; i < cps.length; i++) {
if (name.equals(cps[i].getName()))
@@ -1103,6 +1263,9 @@ public class ParameterSection extends Ab
return false;
}
+ /**
+ * Common action finish.
+ */
private void commonActionFinish() {
valueChanged = true;
commonActionFinishDirtyIfChange();
@@ -1119,6 +1282,10 @@ public class ParameterSection extends Ab
enable();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSectionParm#enable()
+ */
+ @Override
public void enable() {
usingGroupsButton.setEnabled(!isAggregate());
@@ -1139,6 +1306,11 @@ public class ParameterSection extends Ab
&& isGroupSelection() && !isCommonGroupSelection())));
}
+ /**
+ * Gets the tree.
+ *
+ * @return the tree
+ */
public Tree getTree() {
return tree;
}
@@ -1147,8 +1319,8 @@ public class ParameterSection extends Ab
* Given a ConfigurationParameter, find the corresponding item in the tree. Note: parameters with
* the same name can exist in different groups, so we don't match using the parm name, but rather
* do an "EQ" test
- *
- * @param p
+ *
+ * @param p the p
* @return the tree item corresponding to the configuration parameter
*/
private TreeItem getTreeItemParm(ConfigurationParameter p) {
@@ -1166,8 +1338,8 @@ public class ParameterSection extends Ab
/**
* Given a ConfigGroup - find the corresponding tree item. Match is done against the display form
* of the name(s), with special casing for the not-in-any-group and common.
- *
- * @param g
+ *
+ * @param g the g
* @return the tree itme corresponding to a configuration group
*/
private TreeItem getTreeItemGroup(ConfigGroup g) {
@@ -1185,6 +1357,12 @@ public class ParameterSection extends Ab
throw new InternalErrorCDE("invalid state");
}
+ /**
+ * Gets the settings tree group.
+ *
+ * @param groupName the group name
+ * @return the settings tree group
+ */
private TreeItem getSettingsTreeGroup(String groupName) {
TreeItem[] items = settingsTree.getItems();
for (int i = 0; i < items.length; i++) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterSettingsSection.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/ParameterSettingsSection.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/ParameterSettingsSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/ParameterSettingsSection.java Sun Nov 13 16:13:16 2016
@@ -30,6 +30,7 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
/**
* display parameters on the settings page. If groups, show by groups (using Tree metaphor) Note:
* The tree displayed here is an expanded version of the ParameterSection Tree. It differs in 3
@@ -39,6 +40,12 @@ import org.eclipse.ui.forms.IManagedForm
*/
public class ParameterSettingsSection extends AbstractSectionParm {
+ /**
+ * Instantiates a new parameter settings section.
+ *
+ * @param editor the editor
+ * @param parent the parent
+ */
public ParameterSettingsSection(MultiPageEditor editor, Composite parent) {
super(
editor,
@@ -53,6 +60,7 @@ public class ParameterSettingsSection ex
*
* @see org.eclipse.ui.forms.IFormPart#initialize(org.eclipse.ui.forms.IManagedForm)
*/
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
Composite sectionClient = new2ColumnComposite(this.getSection());
@@ -72,6 +80,7 @@ public class ParameterSettingsSection ex
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
super.refresh();
@@ -91,6 +100,7 @@ public class ParameterSettingsSection ex
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
if (event.type == SWT.MouseHover) {
showDescriptionAsToolTip(event);
@@ -99,13 +109,19 @@ public class ParameterSettingsSection ex
}
}
+ /**
+ * Gets the tree.
+ *
+ * @return the tree
+ */
public Tree getTree() {
return tree;
}
/**
- * called by the Values section
- *
+ * called by the Values section.
+ *
+ * @return the selected param name
*/
public String getSelectedParamName() {
TreeItem[] items = tree.getSelection();
@@ -118,6 +134,11 @@ public class ParameterSettingsSection ex
return null;
}
+ /**
+ * Gets the selected param group name.
+ *
+ * @return the selected param group name
+ */
public String getSelectedParamGroupName() {
TreeItem[] items = tree.getSelection();
if (items.length == 0)
@@ -133,6 +154,11 @@ public class ParameterSettingsSection ex
return null;
}
+ /**
+ * Gets the selected model parameter.
+ *
+ * @return the selected model parameter
+ */
public ConfigurationParameter getSelectedModelParameter() {
TreeItem[] items = tree.getSelection();
if (items.length == 0)
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.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/PrimitiveSection.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/PrimitiveSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PrimitiveSection.java Sun Nov 13 16:13:16 2016
@@ -42,36 +42,53 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.SelectionDialog;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
/**
- * This class is misnamed - refers really to Runtime Information
- *
+ * This class is misnamed - refers really to Runtime Information.
*/
public class PrimitiveSection extends AbstractSection {
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#enable()
+ */
+ @Override
public void enable() {
}
+ /** The impl name label. */
private Label implNameLabel;
+ /** The impl name. */
private Text implName;
+ /** The find button. */
private Button findButton;
+ /** The multiple deployment allowed. */
private Button multipleDeploymentAllowed;
+ /** The modifies cas. */
private Button modifiesCas;
+ /** The outputs new CA ses. */
private Button outputsNewCASes;
/**
* Creates a section with a text field for the name of the annotator. Only enabled if annotator is
* primitive Also has the operational parameters
+ *
+ * @param editor the editor
+ * @param parent the parent
*/
public PrimitiveSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Runtime Information",
"This section describes information about how to run this component");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
@@ -112,6 +129,7 @@ public class PrimitiveSection extends Ab
*
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
super.refresh();
@@ -156,6 +174,7 @@ public class PrimitiveSection extends Ab
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
valueChanged = false;
OperationalProperties ops = getOperationalProperties();
@@ -210,8 +229,9 @@ public class PrimitiveSection extends Ab
}
/**
- * @param enabled
- * indicator for the section to be enabled.
+ * Sets the enabled.
+ *
+ * @param enabled indicator for the section to be enabled.
*/
public void setEnabled(boolean enabled) {
implNameLabel.setEnabled(enabled);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PriorityListSection.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/PriorityListSection.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/PriorityListSection.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/PriorityListSection.java Sun Nov 13 16:13:16 2016
@@ -35,30 +35,53 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.forms.IManagedForm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class PriorityListSection.
+ */
public class PriorityListSection extends AbstractSection {
+ /** The Constant PRIORITY_LIST. */
public static final String PRIORITY_LIST = "<Priority List>";
+ /** The tree. */
private Tree tree;
+ /** The add set button. */
private Button addSetButton;
+ /** The add button. */
private Button addButton;
+ /** The remove button. */
private Button removeButton;
+ /** The up button. */
private Button upButton;
+ /** The down button. */
private Button downButton;
+ /** The type priority import section. */
private TypePriorityImportSection typePriorityImportSection;
+ /** The export button. */
private Button exportButton;
+ /**
+ * Instantiates a new priority list section.
+ *
+ * @param editor the editor
+ * @param parent the parent
+ */
public PriorityListSection(MultiPageEditor editor, Composite parent) {
super(editor, parent, "Priority Lists", "This section shows the defined Prioirity Lists");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#initialize(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
public void initialize(IManagedForm form) {
super.initialize(form);
@@ -87,6 +110,7 @@ public class PriorityListSection extends
*
* @see org.eclipse.ui.forms.IFormPart#refresh()
*/
+ @Override
public void refresh() {
if (null == typePriorityImportSection)
typePriorityImportSection = editor.getIndexesPage().getTypePriorityImportSection();
@@ -116,12 +140,22 @@ public class PriorityListSection extends
enable();
}
+ /**
+ * Gets the type priority list from tree item.
+ *
+ * @param item the item
+ * @return the type priority list from tree item
+ */
public TypePriorityList getTypePriorityListFromTreeItem(TreeItem item) {
TypePriorityList[] typePriorityLists = getAnalysisEngineMetaData().getTypePriorities()
.getPriorityLists();
return typePriorityLists[tree.indexOf(item)];
}
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
public void handleEvent(Event event) {
if (event.widget == addSetButton) {
TypePriorityList typePriorityList = UIMAFramework.getResourceSpecifierFactory()
@@ -252,6 +286,10 @@ public class PriorityListSection extends
enable();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.AbstractSection#enable()
+ */
+ @Override
public void enable() {
if (tree.getSelectionCount() == 1) {