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 [12/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/AddTypeDialog.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/AddTypeDialog.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/AddTypeDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddTypeDialog.java Sun Nov 13 16:13:16 2016
@@ -36,46 +36,69 @@ import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddTypeDialog.
+ */
public class AddTypeDialog extends AbstractDialogKeyVerifyJavaNames {
+ /** The type name UI. */
private StyledText typeNameUI;
+ /** The supertype name UI. */
private Text supertypeNameUI;
+ /** The description UI. */
private Text descriptionUI;
+ /** The type name. */
public String typeName;
+ /** The original type name. */
private String originalTypeName;
+ /** The supertype name. */
public String supertypeName;
+ /** The description. */
public String description;
+ /** The type section. */
private TypeSection typeSection;
+ /** The existing td. */
private TypeDescription existingTd = null;
+ /** The all types list. */
private TypesWithNameSpaces allTypesList;
// private boolean seenThisAlready = false;
+ /**
+ * Instantiates a new adds the type dialog.
+ *
+ * @param aSection the a section
+ */
public AddTypeDialog(AbstractSection aSection) {
super(aSection, "Add a Type", "Use this panel to specify a type.");
typeSection = (TypeSection) aSection;
}
/**
- * Constructor for Editing an existing Type DescriptionD
- *
- * @param aSection
- * @param aExistingTd
+ * Constructor for Editing an existing Type DescriptionD.
+ *
+ * @param aSection the a section
+ * @param aExistingTd the a existing td
*/
public AddTypeDialog(AbstractSection aSection, TypeDescription aExistingTd) {
this(aSection);
existingTd = aExistingTd;
}
+ /* (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, existingTd);
createWideLabel(mainArea,
@@ -113,11 +136,15 @@ public class AddTypeDialog extends Abstr
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#getTypeSystemInfoList()
+ */
/*
* Supplies the list of valid types
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#getTypeSystemInfoList()
*/
+ @Override
public TypesWithNameSpaces getTypeSystemInfoList() {
TypesWithNameSpaces result = super.getTypeSystemInfoList();
boolean hasFeatures = false;
@@ -133,6 +160,7 @@ public class AddTypeDialog extends Abstr
}
Type[] allTypes = (Type[]) editor.allTypes.get().values().toArray(new Type[0]);
Arrays.sort(allTypes, new Comparator() {
+ @Override
public int compare(Object o1, Object o2) {
Type t1 = (Type) o1;
Type t2 = (Type) o2;
@@ -152,12 +180,20 @@ public class AddTypeDialog extends Abstr
return result;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
typeName = typeNameUI.getText();
description = nullIf0lengthString(descriptionUI.getText());
supertypeName = supertypeNameUI.getText();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
if (typeName.length() == 0)
return false;
@@ -188,6 +224,10 @@ public class AddTypeDialog extends Abstr
return true;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled(typeName.length() > 0);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddTypeToPriorityListDialog.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/AddTypeToPriorityListDialog.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/AddTypeToPriorityListDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/AddTypeToPriorityListDialog.java Sun Nov 13 16:13:16 2016
@@ -33,20 +33,28 @@ import org.eclipse.swt.widgets.List;
import org.apache.uima.cas.CAS;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AddTypeToPriorityListDialog.
+ */
public class AddTypeToPriorityListDialog extends AbstractDialog {
+ /** The m selected type names. */
private String[] m_selectedTypeNames; // this is the selection
+ /** The m available type names. */
private String[] m_availableTypeNames;
+ /** The type list. */
private List typeList;
/**
- *
- * @param aSection
- * @param allowableTypeNameHash
- * @param typesInList
+ * Instantiates a new adds the type to priority list dialog.
+ *
+ * @param aSection the a section
+ * @param allowableTypeNameHash the allowable type name hash
+ * @param typesInList the types in list
*/
public AddTypeToPriorityListDialog(AbstractSection aSection, Set allowableTypeNameHash,
String[] typesInList) {
@@ -55,6 +63,13 @@ public class AddTypeToPriorityListDialog
m_availableTypeNames = getAvailableTypeNames(allowableTypeNameHash, typesInList);
}
+ /**
+ * Gets the available type names.
+ *
+ * @param allowableTypeNameHash the allowable type name hash
+ * @param alreadyUsedTypes the already used types
+ * @return the available type names
+ */
private String[] getAvailableTypeNames(Set allowableTypeNameHash, String[] alreadyUsedTypes) {
Arrays.sort(alreadyUsedTypes);
@@ -76,6 +91,10 @@ public class AddTypeToPriorityListDialog
return availableTypeNames;
}
+ /* (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 composite = (Composite) super.createDialogArea(parent);
@@ -92,10 +111,19 @@ public class AddTypeToPriorityListDialog
return composite;
}
+ /**
+ * Gets the selected type names.
+ *
+ * @return the selected type names
+ */
public String[] getSelectedTypeNames() {
- return (String[]) m_selectedTypeNames.clone();
+ return m_selectedTypeNames.clone();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
m_selectedTypeNames = new String[typeList.getSelectionCount()];
for (int i = 0, j = 0; i < m_availableTypeNames.length; i++) {
@@ -105,6 +133,10 @@ public class AddTypeToPriorityListDialog
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
return true;
}
@@ -114,6 +146,7 @@ public class AddTypeToPriorityListDialog
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
*/
+ @Override
public void enableOK() {
okButton.setEnabled(true);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/CommonInputDialog.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/CommonInputDialog.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/CommonInputDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/CommonInputDialog.java Sun Nov 13 16:13:16 2016
@@ -27,48 +27,84 @@ import org.eclipse.swt.widgets.Control;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
/**
+ * The Class CommonInputDialog.
*/
public class CommonInputDialog extends AbstractDialogKeyVerify {
+ /** The Constant PLAIN_NAME. */
public static final int PLAIN_NAME = 1;
+ /** The Constant DOTTED_NAME. */
public static final int DOTTED_NAME = 1 << 1;
+ /** The Constant SPACED_NAMES. */
public static final int SPACED_NAMES = 1 << 2;
+ /** The Constant LANGUAGE. */
public static final int LANGUAGE = 1 << 3;
+ /** The Constant ALLOK. */
public static final int ALLOK = 1 << 4;
+ /** The Constant TRUE_FALSE. */
public static final int TRUE_FALSE = 1 << 5;
+ /** The Constant INTEGER. */
public static final int INTEGER = 1 << 6;
+ /** The Constant FLOAT. */
public static final int FLOAT = 1 << 7;
+ /** The Constant GROUP_NAMES. */
public static final int GROUP_NAMES = DOTTED_NAME | SPACED_NAMES | LANGUAGE;
+ /** The validation. */
private int validation;
+ /** The existing. */
private String existing;
+ /** The text. */
private StyledText text;
+ /** The result. */
private String result;
+ /**
+ * Instantiates a new common input dialog.
+ *
+ * @param aSection the a section
+ * @param title the title
+ * @param dialogDescription the dialog description
+ * @param aKind the a kind
+ */
public CommonInputDialog(AbstractSection aSection, String title, String dialogDescription,
int aKind) {
super(aSection, title, dialogDescription);
validation = aKind;
}
+ /**
+ * Instantiates a new common input dialog.
+ *
+ * @param aSection the a section
+ * @param title the title
+ * @param dialogDescription the dialog description
+ * @param aKind the a kind
+ * @param aExisting the a existing
+ */
public CommonInputDialog(AbstractSection aSection, String title, String dialogDescription,
int aKind, String aExisting) {
this(aSection, title, dialogDescription, aKind);
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 mainArea = (Composite) super.createDialogArea(parent, existing);
@@ -84,6 +120,10 @@ public class CommonInputDialog extends A
return mainArea;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialogKeyVerify#verifyKeyChecks(org.eclipse.swt.events.VerifyEvent)
+ */
+ @Override
public boolean verifyKeyChecks(VerifyEvent event) {
char ch = event.character;
@@ -129,19 +169,36 @@ public class CommonInputDialog extends A
return false;
}
+ /**
+ * Gets the value.
+ *
+ * @return the value
+ */
public String getValue() {
return result;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled("".equals(errorMessageUI.getText()) && (text.getText().length() > 0));
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
result = text.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/ContentAssistField32.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/ContentAssistField32.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/ContentAssistField32.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/ContentAssistField32.java Sun Nov 13 16:13:16 2016
@@ -27,10 +27,21 @@ import org.eclipse.swt.widgets.Composite
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.fieldassist.ContentAssistField;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ContentAssistField32.
+ */
public class ContentAssistField32 {
+ /** The caf. */
final private ContentAssistField caf;
+ /**
+ * Instantiates a new content assist field 32.
+ *
+ * @param tc the tc
+ * @param candidatesToPickFrom the candidates to pick from
+ */
ContentAssistField32(Composite tc, TypesWithNameSpaces candidatesToPickFrom) {
TypesWithNameSpaces32 twns32 = new TypesWithNameSpaces32(candidatesToPickFrom);
caf = new ContentAssistField(tc, SWT.BORDER, new org.eclipse.jface.fieldassist.TextControlCreator(),
@@ -39,6 +50,11 @@ public class ContentAssistField32 {
caf.getContentAssistCommandAdapter().setProposalAcceptanceStyle(org.eclipse.jface.fieldassist.ContentProposalAdapter.PROPOSAL_REPLACE);
}
+ /**
+ * Gets the control.
+ *
+ * @return the control
+ */
public Text getControl() {
return (Text) caf.getControl();
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/EditSofaBindingsDialog.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/EditSofaBindingsDialog.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/EditSofaBindingsDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/EditSofaBindingsDialog.java Sun Nov 13 16:13:16 2016
@@ -31,21 +31,30 @@ import org.eclipse.swt.widgets.TableItem
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class EditSofaBindingsDialog.
+ */
public class EditSofaBindingsDialog extends AbstractDialog {
+ /** The selected sofa names. */
public String[] selectedSofaNames; // this is the selection indexes into next
+ /** The avail and bound sofas. */
private Map availAndBoundSofas;
+ /** The aggr sofa name. */
private String aggrSofaName;
+ /** The table. */
private Table table;
/**
- *
- * @param aSection
- * @param aAggrSofaName
- * @param aAvailAndBoundSofas
+ * Instantiates a new edits the sofa bindings dialog.
+ *
+ * @param aSection the a section
+ * @param aAggrSofaName the a aggr sofa name
+ * @param aAvailAndBoundSofas the a avail and bound sofas
*/
public EditSofaBindingsDialog(AbstractSection aSection, String aAggrSofaName,
Map aAvailAndBoundSofas) {
@@ -55,6 +64,10 @@ public class EditSofaBindingsDialog exte
aggrSofaName = aAggrSofaName;
}
+ /* (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
//
@@ -85,6 +98,10 @@ public class EditSofaBindingsDialog exte
return composite;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
+ */
+ @Override
public void copyValuesFromGUI() {
selectedSofaNames = new String[table.getSelectionCount()];
for (int i = 0, j = 0; i < table.getItemCount(); i++) {
@@ -94,6 +111,10 @@ public class EditSofaBindingsDialog exte
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
+ */
+ @Override
public boolean isValid() {
// TODO Auto-generated method stub
return true;
@@ -104,6 +125,7 @@ public class EditSofaBindingsDialog exte
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
*/
+ @Override
public void enableOK() {
okButton.setEnabled(true);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/ExportImportablePartDialog.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/ExportImportablePartDialog.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/ExportImportablePartDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/ExportImportablePartDialog.java Sun Nov 13 16:13:16 2016
@@ -36,27 +36,56 @@ 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 ExportImportablePartDialog.
+ */
public class ExportImportablePartDialog extends AbstractDialog {
+ /** The base file name UI. */
private Text baseFileNameUI;
+ /** 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 base file name. */
public String baseFileName;
+ /**
+ * 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(baseFileName + ".xml");
@@ -69,7 +98,23 @@ public class ExportImportablePartDialog
}
}
+ /**
+ * 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}''",
@@ -80,12 +125,21 @@ public class ExportImportablePartDialog
}
}
+ /**
+ * Instantiates a new export importable part dialog.
+ *
+ * @param aSection the a section
+ */
public ExportImportablePartDialog(AbstractSection aSection) {
super(aSection, "Export an importable part",
"Specify a base file name, and perhaps alter the path where it should be stored, and press OK");
rootPath = aSection.editor.getFile().getParent().getLocation().toString() + '/';
}
+ /* (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);
@@ -129,6 +183,10 @@ public class ExportImportablePartDialog
return composite;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
boolean bEnableOk = (baseFileNameUI != null && !baseFileNameUI.getText().trim().equals(""));
okButton.setEnabled(bEnableOk);
@@ -139,12 +197,17 @@ public class ExportImportablePartDialog
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
*/
+ @Override
public void copyValuesFromGUI() {
genFilePath = genFilePathUI.getText();
isImportByName = importByNameUI.getSelection();
CDEpropertyPage.setImportByDefault(editor.getProject(), isImportByName ? "name" : "location");
}
+ /* (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/FindComponentDialog.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/FindComponentDialog.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/FindComponentDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/FindComponentDialog.java Sun Nov 13 16:13:16 2016
@@ -35,32 +35,46 @@ import org.eclipse.swt.widgets.Text;
import org.apache.uima.taeconfigurator.TAEConfiguratorPlugin;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class FindComponentDialog.
+ */
public class FindComponentDialog extends AbstractDialog {
+ /** The output type text. */
private Text searchByNameText, inputTypeText, outputTypeText;
+ /** The look in combo. */
private CCombo lookInCombo;
+ /** The m matching delegate componet descriptors. */
private List m_matchingDelegateComponetDescriptors;
+ /** The m matching delegate component descriptions. */
private List m_matchingDelegateComponentDescriptions;
+ /** The cancel button. */
private Button cancelButton;
+ /** The Constant ALL_PROJECTS. */
public static final String ALL_PROJECTS = "All projects";
+ /** The status label 2. */
private Label statusLabel1, statusLabel2;
+ /** The m search thread. */
private SearchThread m_searchThread = null;
+ /** The component headers. */
private String[] componentHeaders;
/**
- *
- * @param aSection
- * @param title
- * @param header
- * @param componentHeaders
+ * Instantiates a new find component dialog.
+ *
+ * @param aSection the a section
+ * @param title the title
+ * @param header the header
+ * @param componentHeaders the component headers
*/
public FindComponentDialog(AbstractSection aSection, String title, String header,
String[] componentHeaders) {
@@ -68,6 +82,10 @@ public class FindComponentDialog extends
this.componentHeaders = componentHeaders;
}
+ /* (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);
@@ -106,6 +124,10 @@ public class FindComponentDialog extends
return composite;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
// create OK and Cancel buttons by default
createButton(parent, IDialogConstants.OK_ID, "Search", true);
@@ -114,6 +136,11 @@ public class FindComponentDialog extends
cancelButton.setEnabled(false);
}
+ /**
+ * Gets the project names.
+ *
+ * @return the project names
+ */
private String[] getProjectNames() {
IProject[] projects = TAEConfiguratorPlugin.getWorkspace().getRoot().getProjects();
String[] projectNames = new String[projects.length];
@@ -125,7 +152,11 @@ public class FindComponentDialog extends
}
// also called by Search Monitoring Thread when
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#buttonPressed(int)
+ */
// it notices the search thread is finished
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) { // start search
if (null != m_searchThread)
@@ -148,8 +179,16 @@ public class FindComponentDialog extends
}
}
+ /** The Constant needToEscapeTheseChars. */
private static final String needToEscapeTheseChars =
".+{}()\\";
+
+ /**
+ * Convert to regex search pattern.
+ *
+ * @param searchPattern the search pattern
+ * @return the string
+ */
private String convertToRegexSearchPattern(String searchPattern) {
if (searchPattern == null || searchPattern.equals("")) {
return null;
@@ -170,18 +209,38 @@ public class FindComponentDialog extends
return new String(buffer);
}
+ /**
+ * Gets the matching delegate component descriptors.
+ *
+ * @return the matching delegate component descriptors
+ */
public List getMatchingDelegateComponentDescriptors() {
return m_matchingDelegateComponetDescriptors;
}
+ /**
+ * Gets the matching delegate component descriptions.
+ *
+ * @return the matching delegate component descriptions
+ */
public List getMatchingDelegateComponentDescriptions() {
return m_matchingDelegateComponentDescriptions;
}
+ /**
+ * Gets the status label 1.
+ *
+ * @return the status label 1
+ */
public Label getStatusLabel1() {
return statusLabel1;
}
+ /**
+ * Gets the status label 2.
+ *
+ * @return the status label 2
+ */
public Label getStatusLabel2() {
return statusLabel2;
}
@@ -191,6 +250,7 @@ public class FindComponentDialog extends
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
*/
+ @Override
public void copyValuesFromGUI() {
String fileNameSearch = convertToRegexSearchPattern(searchByNameText.getText());
String inputTypeSearch = convertToRegexSearchPattern(inputTypeText.getText());
@@ -211,6 +271,7 @@ public class FindComponentDialog extends
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
*/
+ @Override
public boolean isValid() {
return true;
}
@@ -220,6 +281,7 @@ public class FindComponentDialog extends
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
*/
+ @Override
public void enableOK() {
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/PickTaeForTypesDialog.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/PickTaeForTypesDialog.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/PickTaeForTypesDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/PickTaeForTypesDialog.java Sun Nov 13 16:13:16 2016
@@ -37,32 +37,62 @@ import org.apache.uima.resource.metadata
import org.apache.uima.taeconfigurator.CDEpropertyPage;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class PickTaeForTypesDialog.
+ */
public class PickTaeForTypesDialog extends AbstractDialog {
+
+ /** The m delegate component descriptions. */
private java.util.List m_DelegateComponentDescriptors, m_delegateComponentDescriptions;
+ /** The m selected delegate component descriptors. */
private String[] m_selectedDelegateComponentDescriptors;
+ /** The m aggregate file name. */
// private boolean m_bAutoAddToFlow;
private String m_aggregateFileName;
+ /** The delegate component description text. */
private Text delegateComponentDescriptionText;
+ /** The delegate component list GUI. */
List delegateComponentListGUI;
+ /** The input types list. */
private List inputTypesList;
+ /** The output types list. */
private List outputTypesList;
+ /** The dialog selection listener. */
// private Button autoAddToFlowButton;
private DialogSelectionListener dialogSelectionListener = new DialogSelectionListener();
+ /** 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 listener interface for receiving dialogSelection events.
+ * The class that is interested in processing a dialogSelection
+ * event implements this interface, and the object created
+ * with that class is registered with a component using the
+ * component's <code>addDialogSelectionListener</code> method. When
+ * the dialogSelection event occurs, that object's appropriate
+ * method is invoked.
+ */
public class DialogSelectionListener implements SelectionListener {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
public void widgetSelected(SelectionEvent e) {
if (e.widget == delegateComponentListGUI) {
update();
@@ -72,17 +102,22 @@ public class PickTaeForTypesDialog exten
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
// nothing to do in this case
}
}
/**
- *
- * @param aSection
- * @param aggregateFileName
- * @param delegateComponentDescriptors
- * @param delegateComponentDescriptions
+ * Instantiates a new pick tae for types dialog.
+ *
+ * @param aSection the a section
+ * @param aggregateFileName the aggregate file name
+ * @param delegateComponentDescriptors the delegate component descriptors
+ * @param delegateComponentDescriptions the delegate component descriptions
*/
public PickTaeForTypesDialog(AbstractSection aSection, String aggregateFileName,
java.util.List delegateComponentDescriptors, java.util.List delegateComponentDescriptions) {
@@ -94,6 +129,10 @@ public class PickTaeForTypesDialog exten
m_delegateComponentDescriptions = delegateComponentDescriptions;
}
+ /* (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);
Label specialMsgLabel = new Label(composite, SWT.WRAP);
@@ -168,6 +207,9 @@ public class PickTaeForTypesDialog exten
return composite;
}
+ /**
+ * Update.
+ */
public void update() {
int nSelectedAeIndex = delegateComponentListGUI.getSelectionIndices()[0];
@@ -204,6 +246,10 @@ public class PickTaeForTypesDialog exten
enableOK();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
+ */
+ @Override
public void enableOK() {
boolean bEnableOk = false;
String[] selections = delegateComponentListGUI.getSelection();
@@ -216,8 +262,13 @@ public class PickTaeForTypesDialog exten
okButton.setEnabled(bEnableOk);
}
+ /**
+ * Gets the selected delegate component descriptors.
+ *
+ * @return the selected delegate component descriptors
+ */
public String[] getSelectedDelegateComponentDescriptors() {
- return (String[]) m_selectedDelegateComponentDescriptors.clone();
+ return m_selectedDelegateComponentDescriptors.clone();
}
// public boolean getAutoAddToFlow() {
@@ -229,6 +280,7 @@ public class PickTaeForTypesDialog exten
*
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
*/
+ @Override
public void copyValuesFromGUI() {
// this is where we do rollup and detect if we need any additional
// types based on types of features and whether we are a supertype
@@ -260,6 +312,7 @@ public class PickTaeForTypesDialog exten
*
* @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/ResourcePickerDialog.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/ResourcePickerDialog.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/ResourcePickerDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/ResourcePickerDialog.java Sun Nov 13 16:13:16 2016
@@ -41,19 +41,39 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ResourcePickerDialog.
+ */
public class ResourcePickerDialog extends AbstractDialog {
+ /** The resources UI. */
protected Tree resourcesUI;
+
+ /** The resources U ic 1. */
protected TreeColumn resourcesUIc1;
+
+ /** The resources U ic 2. */
protected TreeColumn resourcesUIc2;
+
+ /** The picked resource. */
public IResource pickedResource;
+
+ /** The result. */
protected Object [] result;
+ /**
+ * Instantiates a new resource picker dialog.
+ *
+ * @param shell the shell
+ */
public ResourcePickerDialog(Shell shell) {
super(shell, "Select a File", "Use this panel to select a file in the Workspace");
}
+ /** The Constant resourceComparator. */
private static final Comparator resourceComparator = new Comparator () {
+ @Override
public int compare(Object arg0, Object arg1) {
IResource r0 = (IResource) arg0;
IResource r1 = (IResource) arg1;
@@ -61,6 +81,12 @@ public class ResourcePickerDialog extend
}
};
+ /**
+ * Populate.
+ *
+ * @param parent the parent
+ * @param resources the resources
+ */
private void populate(TreeItem parent, IResource[] resources) {
Arrays.sort(resources, resourceComparator);
for (int i = 0; i < resources.length; i++) {
@@ -74,6 +100,10 @@ public class ResourcePickerDialog extend
}
}
+ /* (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);
@@ -87,6 +117,9 @@ public class ResourcePickerDialog extend
return mainArea;
}
+ /**
+ * Setup resources by location.
+ */
protected void setupResourcesByLocation() {
resourcesUI.removeAll();
resourcesUI.removeListener(SWT.Expand, this); // remove to prevent triggering while setting up
@@ -112,6 +145,7 @@ public class ResourcePickerDialog extend
/* (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 == resourcesUI &&
event.type == SWT.Expand) {
@@ -134,6 +168,7 @@ public class ResourcePickerDialog extend
/* (non-Javadoc)
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
*/
+ @Override
public void copyValuesFromGUI() {
if (resourcesUI.getSelectionCount() > 0) {
pickedResource = (IResource)resourcesUI.getSelection()[0].getData();
@@ -148,6 +183,7 @@ public class ResourcePickerDialog extend
/* (non-Javadoc)
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
*/
+ @Override
public void enableOK() {
if ( (0 < resourcesUI.getSelectionCount()) &&
(resourcesUI.getSelection()[0].getData() instanceof IFile)) {
@@ -160,14 +196,25 @@ public class ResourcePickerDialog extend
/* (non-Javadoc)
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#isValid()
*/
+ @Override
public boolean isValid() {
return true;
}
+ /**
+ * Gets the result.
+ *
+ * @return the result
+ */
public Object[] getResult() {
return result;
}
+ /**
+ * Sets the result.
+ *
+ * @param aResult the new result
+ */
public void setResult(List aResult) {
if (null == aResult) {
result = null;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/SearchMonitoringThread.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/SearchMonitoringThread.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/SearchMonitoringThread.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/SearchMonitoringThread.java Sun Nov 13 16:13:16 2016
@@ -22,22 +22,40 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Display;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SearchMonitoringThread.
+ */
public class SearchMonitoringThread extends Thread {
+
+ /** The m search thread. */
private SearchThread m_searchThread;
+ /** The m dialog. */
FindComponentDialog m_dialog;
+ /**
+ * Instantiates a new search monitoring thread.
+ *
+ * @param dialog the dialog
+ * @param searchThread the search thread
+ */
public SearchMonitoringThread(FindComponentDialog dialog, SearchThread searchThread) {
m_dialog = dialog;
m_searchThread = searchThread;
}
+ /* (non-Javadoc)
+ * @see java.lang.Thread#run()
+ */
+ @Override
public void run() {
while (true) {
if (m_searchThread.isDone()) {
if (!m_dialog.getStatusLabel1().isDisposed()) {
Display display = m_dialog.getStatusLabel1().getDisplay();
display.syncExec(new Runnable() {
+ @Override
public void run() {
m_dialog.buttonPressed(IDialogConstants.CANCEL_ID);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/SearchThread.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/SearchThread.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/SearchThread.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/SearchThread.java Sun Nov 13 16:13:16 2016
@@ -38,27 +38,56 @@ import org.apache.uima.taeconfigurator.T
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SearchThread.
+ */
public class SearchThread implements Runnable /* extends Thread */{
+
+ /** The m file name search. */
private Pattern m_fileNameSearch;
+
+ /** The m input type search. */
private Pattern m_inputTypeSearch;
+
+ /** The m output type search. */
private Pattern m_outputTypeSearch;
+ /** The m project to search. */
private String m_projectToSearch;
+ /** The m dialog. */
FindComponentDialog m_dialog;
+ /** The m aggregate section. */
private AbstractSection m_aggregateSection;
+ /** The m matching delegate component descriptors. */
private List m_matchingDelegateComponentDescriptors;
+ /** The m matching delegate component descriptions. */
private List m_matchingDelegateComponentDescriptions;
+ /** The m n which status msg. */
int m_nWhichStatusMsg;
+ /** The m status msg. */
String m_statusMsg;
+ /** The m component headers. */
private String[] m_componentHeaders;
+ /**
+ * Instantiates a new search thread.
+ *
+ * @param dialog the dialog
+ * @param aggregateSection the aggregate section
+ * @param fileNameSearch the file name search
+ * @param inputTypeSearch the input type search
+ * @param outputTypeSearch the output type search
+ * @param projectToSearch the project to search
+ * @param componentHeaders the component headers
+ */
public SearchThread(FindComponentDialog dialog, AbstractSection aggregateSection,
String fileNameSearch, String inputTypeSearch, String outputTypeSearch,
String projectToSearch, String[] componentHeaders) {
@@ -72,22 +101,41 @@ public class SearchThread implements Run
m_componentHeaders = componentHeaders;
}
+ /** The m b die now. */
private boolean m_bDieNow = false;
+ /** The m b done. */
private boolean m_bDone = false;
+ /**
+ * Sets the die now.
+ */
public void setDieNow() {
m_bDieNow = true;
}
+ /**
+ * Gets the die now.
+ *
+ * @return the die now
+ */
public boolean getDieNow() {
return m_bDieNow;
}
+ /**
+ * Checks if is done.
+ *
+ * @return true, if is done
+ */
public boolean isDone() {
return m_bDone;
}
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
public void run() {
m_matchingDelegateComponentDescriptors = new ArrayList();
m_matchingDelegateComponentDescriptions = new ArrayList();
@@ -99,6 +147,11 @@ public class SearchThread implements Run
m_bDone = true;
}
+ /**
+ * Test one resource.
+ *
+ * @param resource the resource
+ */
private void testOneResource(IResource resource) {
switch (resource.getType()) {
case IResource.FILE:
@@ -134,6 +187,12 @@ public class SearchThread implements Run
}
// populates the Vector of matchingAnalysisEngineDescriptors and
+ /**
+ * Gets the delegate components by input output types.
+ *
+ * @param projectToSearch the project to search
+ * @return the delegate components by input output types
+ */
// matchingAnalysisEngineDescriptions
private void getDelegateComponentsByInputOutputTypes(String projectToSearch) {
@@ -170,6 +229,12 @@ public class SearchThread implements Run
}
// populates the Vector of matchingAnalysisEngineDescriptors and
+ /**
+ * Gets the delegate components by IO types beginning at.
+ *
+ * @param beginFolder the begin folder
+ * @return the delegate components by IO types beginning at
+ */
// matchingAnalysisEngineDescriptions
private void getDelegateComponentsByIOTypesBeginningAt(IFolder beginFolder) {
@@ -186,6 +251,14 @@ public class SearchThread implements Run
}
}
+ /**
+ * Delegate component matches capability reqs.
+ *
+ * @param rs the rs
+ * @param inputTypeSearch the input type search
+ * @param outputTypeSearch the output type search
+ * @return true, if successful
+ */
private boolean delegateComponentMatchesCapabilityReqs(ResourceCreationSpecifier rs,
Pattern inputTypeSearch, Pattern outputTypeSearch) {
@@ -203,10 +276,20 @@ public class SearchThread implements Run
return inputSatisfied && outputSatisfied;
}
+ /** The Constant INPUT. */
private static final boolean INPUT = true;
+ /** The Constant OUTPUT. */
private static final boolean OUTPUT = false;
+ /**
+ * Match capabilities to.
+ *
+ * @param capabilities the capabilities
+ * @param search the search
+ * @param isInput the is input
+ * @return true, if successful
+ */
private boolean matchCapabilitiesTo(Capability[] capabilities, Pattern search, boolean isInput) {
if (null == search)
return true;
@@ -224,14 +307,30 @@ public class SearchThread implements Run
return false;
}
+ /**
+ * Gets the matching delegate component descriptors.
+ *
+ * @return the matching delegate component descriptors
+ */
public List getMatchingDelegateComponentDescriptors() {
return m_matchingDelegateComponentDescriptors;
}
+ /**
+ * Gets the matching delegate component descriptions.
+ *
+ * @return the matching delegate component descriptions
+ */
public List getMatchingDelegateComponentDescriptions() {
return m_matchingDelegateComponentDescriptions;
}
+ /**
+ * Sets the status msg.
+ *
+ * @param nWhich the n which
+ * @param msg the msg
+ */
private void setStatusMsg(int nWhich, String msg) {
m_nWhichStatusMsg = nWhich;
m_statusMsg = msg;
@@ -240,6 +339,7 @@ public class SearchThread implements Run
return;
Display display = m_dialog.getStatusLabel1().getDisplay();
display.syncExec(new Runnable() {
+ @Override
public void run() {
if (m_nWhichStatusMsg == 1) {
m_dialog.getStatusLabel1().setText(m_statusMsg);
@@ -251,6 +351,12 @@ public class SearchThread implements Run
}
+ /**
+ * Gets the brief display version.
+ *
+ * @param filePathName the file path name
+ * @return the brief display version
+ */
private String getBriefDisplayVersion(String filePathName) {
if (filePathName == null) {
return null;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/SelectTypeDialog.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/SelectTypeDialog.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/SelectTypeDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/SelectTypeDialog.java Sun Nov 13 16:13:16 2016
@@ -33,17 +33,35 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class SelectTypeDialog.
+ */
public class SelectTypeDialog extends AbstractDialog {
+ /** The type name UI. */
private Text typeNameUI;
+
+ /** The matching types UI. */
private Table matchingTypesUI;
+
+ /** The name spaces UI. */
private Table nameSpacesUI;
+
+ /** The type name. */
public String typeName = "error-TypeName-never-set";
+
+ /** The name space name. */
public String nameSpaceName = "error-NameSpaceName-never-set";
+
+ /** The types. */
private TypesWithNameSpaces types;
+
/**
- * @param section
- * @param types
+ * Instantiates a new select type dialog.
+ *
+ * @param section the section
+ * @param types the types
*/
public SelectTypeDialog(AbstractSection section, TypesWithNameSpaces types) {
super(section, "Select Type Name", "Select an Existing CAS Type name from the set of defined types");
@@ -60,6 +78,7 @@ public class SelectTypeDialog extends Ab
* Create a list output area labeled: NameSpaces:
* Bottom gets normal OK / Cancel buttons
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite mainArea = (Composite)super.createDialogArea(parent);
createWideLabel(mainArea, "Type Name:");
@@ -86,6 +105,11 @@ public class SelectTypeDialog extends Ab
return mainArea;
}
+ /**
+ * Display filtered types.
+ *
+ * @param aTypeName the a type name
+ */
private void displayFilteredTypes(String aTypeName) {
matchingTypesUI.setRedraw(false);
matchingTypesUI.removeAll();
@@ -110,6 +134,11 @@ public class SelectTypeDialog extends Ab
matchingTypesUI.setRedraw(true);
}
+ /**
+ * Display name spaces for selected item.
+ *
+ * @param entry the entry
+ */
private void displayNameSpacesForSelectedItem(Map.Entry entry) {
Set nameSpaces = (Set)entry.getValue();
nameSpacesUI.removeAll();
@@ -127,6 +156,7 @@ public class SelectTypeDialog 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) {
if (event.widget == typeNameUI && event.type == SWT.Modify) {
typeName = typeNameUI.getText();
@@ -143,6 +173,7 @@ public class SelectTypeDialog extends Ab
/* (non-Javadoc)
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#copyValuesFromGUI()
*/
+ @Override
public void copyValuesFromGUI() {
if (0 < matchingTypesUI.getSelectionCount()) {
typeName = matchingTypesUI.getSelection()[0].getText();
@@ -155,6 +186,7 @@ public class SelectTypeDialog extends Ab
/* (non-Javadoc)
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
*/
+ @Override
public void enableOK() {
copyValuesFromGUI();
okButton.setEnabled( (0 < nameSpacesUI.getSelectionCount()) &&
@@ -164,6 +196,7 @@ public class SelectTypeDialog extends Ab
/* (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/TypesWithNameSpaces.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/TypesWithNameSpaces.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/TypesWithNameSpaces.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/TypesWithNameSpaces.java Sun Nov 13 16:13:16 2016
@@ -26,10 +26,20 @@ import java.util.TreeSet;
import org.apache.uima.taeconfigurator.editors.ui.AbstractSection;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class TypesWithNameSpaces.
+ */
public class TypesWithNameSpaces {
+ /** The sorted names. */
public SortedMap sortedNames = new TreeMap();
+ /**
+ * Adds the.
+ *
+ * @param fullname the fullname
+ */
public void add(String fullname) {
String key = AbstractSection.getShortName(fullname);
String nameSpace = AbstractSection.getNameSpace(fullname);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/TypesWithNameSpaces32.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/TypesWithNameSpaces32.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/TypesWithNameSpaces32.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/ui/dialogs/TypesWithNameSpaces32.java Sun Nov 13 16:13:16 2016
@@ -30,27 +30,55 @@ import java.util.SortedMap;
import org.eclipse.jface.fieldassist.IContentProposal;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
+// TODO: Auto-generated Javadoc
/*
* This class forwards to TypesWithNameSpaces
* Purpose: provide content assist under Eclipse 3.2
* (The other class is set up to provide browse assist under 3.1 or higher Eclipse)
*/
+/**
+ * The Class TypesWithNameSpaces32.
+ */
public class TypesWithNameSpaces32 implements IContentProposalProvider {
+ /** The sorted names. */
final private SortedMap sortedNames;
+ /**
+ * Instantiates a new types with name spaces 32.
+ *
+ * @param aBase the a base
+ */
public TypesWithNameSpaces32(TypesWithNameSpaces aBase) {
sortedNames = aBase.sortedNames;
}
+ /** The proposal array. */
private CasTypeProposal [] proposalArray = null;
+ /**
+ * The Class CasTypeProposal.
+ */
public static class CasTypeProposal
implements IContentProposal, Comparable {
+
+ /** The label form. */
private final String labelForm;
+
+ /** The full name. */
private final String fullName;
+
+ /** The compare key. */
private final String compareKey;
+
+ /**
+ * Instantiates a new cas type proposal.
+ *
+ * @param aCompareKey the a compare key
+ * @param shortName the short name
+ * @param nameSpace the name space
+ */
/* (non-Javadoc)
* @see org.eclipse.jface.fieldassist.IContentProposal#getContent()
*/
@@ -60,24 +88,31 @@ public class TypesWithNameSpaces32 imple
compareKey = aCompareKey.toLowerCase();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.fieldassist.IContentProposal#getContent()
+ */
+ @Override
public String getContent() {
return fullName;
}
/* (non-Javadoc)
* @see org.eclipse.jface.fieldassist.IContentProposal#getCursorPosition()
*/
+ @Override
public int getCursorPosition() {
return fullName.length();
}
/* (non-Javadoc)
* @see org.eclipse.jface.fieldassist.IContentProposal#getDescription()
*/
+ @Override
public String getDescription() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.fieldassist.IContentProposal#getLabel()
*/
+ @Override
public String getLabel() {
if (labelForm.toLowerCase().startsWith(compareKey))
return labelForm;
@@ -85,18 +120,27 @@ public class TypesWithNameSpaces32 imple
return fullName;
}
+ /**
+ * Gets the compare key.
+ *
+ * @return the compare key
+ */
public String getCompareKey() {
return compareKey;
}
/* (non-Javadoc)
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
+ @Override
public int compareTo(Object arg0) throws ClassCastException {
final CasTypeProposal c = (CasTypeProposal) arg0;
return this.compareKey.compareTo(c.getCompareKey());
}
}
+ /**
+ * Creates the proposal array.
+ */
public void createProposalArray() {
List r = new ArrayList(sortedNames.size()*2);
@@ -120,6 +164,11 @@ public class TypesWithNameSpaces32 imple
Arrays.sort(proposalArray);
}
+ /**
+ * Gets the proposal array.
+ *
+ * @return the proposal array
+ */
public CasTypeProposal [] getProposalArray() {
return proposalArray;
}
@@ -127,6 +176,7 @@ public class TypesWithNameSpaces32 imple
/* (non-Javadoc)
* @see org.eclipse.jface.fieldassist.IContentProposalProvider#getProposals(java.lang.String, int)
*/
+ @Override
public IContentProposal[] getProposals(String contents, int position) {
if (null == proposalArray)
createProposalArray();
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/ColorManager.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/ColorManager.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/xml/ColorManager.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/ColorManager.java Sun Nov 13 16:13:16 2016
@@ -27,16 +27,30 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ColorManager.
+ */
public class ColorManager {
+ /** The color table. */
protected Map fColorTable = new HashMap(10);
+ /**
+ * Dispose.
+ */
public void dispose() {
Iterator e = fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
}
+ /**
+ * Gets the color.
+ *
+ * @param rgb the rgb
+ * @return the color
+ */
public Color getColor(RGB rgb) {
Color color = (Color) fColorTable.get(rgb);
if (color == null) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/IXMLColorConstants.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/IXMLColorConstants.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/xml/IXMLColorConstants.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/IXMLColorConstants.java Sun Nov 13 16:13:16 2016
@@ -21,14 +21,24 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.swt.graphics.RGB;
+// TODO: Auto-generated Javadoc
+/**
+ * The Interface IXMLColorConstants.
+ */
public interface IXMLColorConstants {
+
+ /** The xml comment. */
RGB XML_COMMENT = new RGB(128, 0, 0);
+ /** The proc instr. */
RGB PROC_INSTR = new RGB(128, 128, 128);
+ /** The string. */
RGB STRING = new RGB(0, 128, 0);
+ /** The default. */
RGB DEFAULT = new RGB(0, 0, 0);
+ /** The tag. */
RGB TAG = new RGB(0, 0, 128);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/NonRuleBasedDamagerRepairer.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/NonRuleBasedDamagerRepairer.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/xml/NonRuleBasedDamagerRepairer.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/NonRuleBasedDamagerRepairer.java Sun Nov 13 16:13:16 2016
@@ -32,16 +32,22 @@ import org.eclipse.jface.text.presentati
import org.eclipse.jface.util.Assert;
import org.eclipse.swt.custom.StyleRange;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class NonRuleBasedDamagerRepairer.
+ */
public class NonRuleBasedDamagerRepairer implements IPresentationDamager, IPresentationRepairer {
- /** The document this object works on */
+ /** The document this object works on. */
protected IDocument fDocument;
- /** The default text attribute if non is returned as data by the current token */
+ /** The default text attribute if non is returned as data by the current token. */
protected TextAttribute fDefaultTextAttribute;
/**
* Constructor for NonRuleBasedDamagerRepairer.
+ *
+ * @param defaultTextAttribute the default text attribute
*/
public NonRuleBasedDamagerRepairer(TextAttribute defaultTextAttribute) {
Assert.isNotNull(defaultTextAttribute);
@@ -50,8 +56,12 @@ public class NonRuleBasedDamagerRepairer
}
/**
+ * Sets the document.
+ *
+ * @param document the new document
* @see IPresentationRepairer#setDocument(IDocument)
*/
+ @Override
public void setDocument(IDocument document) {
fDocument = document;
}
@@ -82,8 +92,15 @@ public class NonRuleBasedDamagerRepairer
}
/**
+ * Gets the damage region.
+ *
+ * @param partition the partition
+ * @param event the event
+ * @param documentPartitioningChanged the document partitioning changed
+ * @return the damage region
* @see IPresentationDamager#getDamageRegion(ITypedRegion, DocumentEvent, boolean)
*/
+ @Override
public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent event,
boolean documentPartitioningChanged) {
if (!documentPartitioningChanged) {
@@ -112,8 +129,13 @@ public class NonRuleBasedDamagerRepairer
}
/**
+ * Creates the presentation.
+ *
+ * @param presentation the presentation
+ * @param region the region
* @see IPresentationRepairer#createPresentation(TextPresentation, ITypedRegion)
*/
+ @Override
public void createPresentation(TextPresentation presentation, ITypedRegion region) {
addRange(presentation, region.getOffset(), region.getLength(), fDefaultTextAttribute);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/TagRule.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/TagRule.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/xml/TagRule.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/TagRule.java Sun Nov 13 16:13:16 2016
@@ -21,12 +21,25 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.text.rules.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class TagRule.
+ */
public class TagRule extends MultiLineRule {
+ /**
+ * Instantiates a new tag rule.
+ *
+ * @param token the token
+ */
public TagRule(IToken token) {
super("<", ">", token);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.rules.PatternRule#sequenceDetected(org.eclipse.jface.text.rules.ICharacterScanner, char[], boolean)
+ */
+ @Override
protected boolean sequenceDetected(ICharacterScanner scanner, char[] sequence, boolean eofAllowed) {
int c = scanner.read();
if (sequence[0] == '<') {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLConfiguration.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/xml/XMLConfiguration.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLConfiguration.java Sun Nov 13 16:13:16 2016
@@ -31,24 +31,46 @@ import org.eclipse.jface.text.source.Sou
import org.apache.uima.taeconfigurator.editors.MultiPageEditorContributor;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLConfiguration.
+ */
public class XMLConfiguration extends SourceViewerConfiguration {
+
+ /** The double click strategy. */
private XMLDoubleClickStrategy doubleClickStrategy;
+ /** The tag scanner. */
private XMLTagScanner tagScanner;
+ /** The scanner. */
private XMLScanner scanner;
+ /** The color manager. */
private ColorManager colorManager;
+ /**
+ * Instantiates a new XML configuration.
+ *
+ * @param colorManager the color manager
+ */
public XMLConfiguration(ColorManager colorManager) {
this.colorManager = colorManager;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getConfiguredContentTypes(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ @Override
public String[] getConfiguredContentTypes(ISourceViewer sourceViewer) {
return new String[] { IDocument.DEFAULT_CONTENT_TYPE, XMLPartitionScanner.XML_COMMENT,
XMLPartitionScanner.XML_TAG };
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getDoubleClickStrategy(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+ */
+ @Override
public ITextDoubleClickStrategy getDoubleClickStrategy(ISourceViewer sourceViewer,
String contentType) {
if (doubleClickStrategy == null)
@@ -56,6 +78,11 @@ public class XMLConfiguration extends So
return doubleClickStrategy;
}
+ /**
+ * Gets the XML scanner.
+ *
+ * @return the XML scanner
+ */
protected XMLScanner getXMLScanner() {
if (scanner == null) {
scanner = new XMLScanner(colorManager);
@@ -65,6 +92,11 @@ public class XMLConfiguration extends So
return scanner;
}
+ /**
+ * Gets the XML tag scanner.
+ *
+ * @return the XML tag scanner
+ */
protected XMLTagScanner getXMLTagScanner() {
if (tagScanner == null) {
tagScanner = new XMLTagScanner(colorManager);
@@ -74,6 +106,10 @@ public class XMLConfiguration extends So
return tagScanner;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
+ */
+ @Override
public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
@@ -93,17 +129,25 @@ public class XMLConfiguration extends So
return reconciler;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTabWidth(org.eclipse.jface.text.source.ISourceViewer)
+ */
// these 2 functions don't seem to control indent
+ @Override
public int getTabWidth(ISourceViewer sourceViewer) {
return MultiPageEditorContributor.getXMLindent();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getIndentPrefixes(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
+ */
+ @Override
public String[] getIndentPrefixes(ISourceViewer sourceViewer, String contentType) {
StringBuffer spaces = new StringBuffer(4);
int indent = getTabWidth(null);
for (int i = 0; i < indent; i++)
spaces.append(' ');
- return new String[] { "\t", spaces.toString() /* , "" */}; //$NON-NLS-1$ //$NON-NLS-2$
+ return new String[] { "\t", spaces.toString() /* , "" */}; //$NON-NLS-1$
}
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLDocumentProvider.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLDocumentProvider.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/xml/XMLDocumentProvider.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLDocumentProvider.java Sun Nov 13 16:13:16 2016
@@ -25,8 +25,16 @@ import org.eclipse.jface.text.IDocumentP
import org.eclipse.jface.text.rules.DefaultPartitioner;
import org.eclipse.ui.editors.text.FileDocumentProvider;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLDocumentProvider.
+ */
public class XMLDocumentProvider extends FileDocumentProvider {
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.StorageDocumentProvider#createDocument(java.lang.Object)
+ */
+ @Override
protected IDocument createDocument(Object element) throws CoreException {
IDocument document = super.createDocument(element);
if (document != null) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLDoubleClickStrategy.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLDoubleClickStrategy.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/xml/XMLDoubleClickStrategy.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLDoubleClickStrategy.java Sun Nov 13 16:13:16 2016
@@ -21,9 +21,19 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.text.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLDoubleClickStrategy.
+ */
public class XMLDoubleClickStrategy implements ITextDoubleClickStrategy {
+
+ /** The text. */
protected ITextViewer fText;
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.ITextDoubleClickStrategy#doubleClicked(org.eclipse.jface.text.ITextViewer)
+ */
+ @Override
public void doubleClicked(ITextViewer part) {
int pos = part.getSelectedRange().x;
@@ -37,6 +47,12 @@ public class XMLDoubleClickStrategy impl
}
}
+ /**
+ * Select comment.
+ *
+ * @param caretPos the caret pos
+ * @return true, if successful
+ */
protected boolean selectComment(int caretPos) {
IDocument doc = fText.getDocument();
int startPos, endPos;
@@ -86,6 +102,12 @@ public class XMLDoubleClickStrategy impl
return false;
}
+ /**
+ * Select word.
+ *
+ * @param caretPos the caret pos
+ * @return true, if successful
+ */
protected boolean selectWord(int caretPos) {
IDocument doc = fText.getDocument();
@@ -125,6 +147,12 @@ public class XMLDoubleClickStrategy impl
return false;
}
+ /**
+ * Select range.
+ *
+ * @param startPos the start pos
+ * @param stopPos the stop pos
+ */
private void selectRange(int startPos, int stopPos) {
int offset = startPos + 1;
int length = stopPos - offset;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLEditor.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLEditor.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/xml/XMLEditor.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLEditor.java Sun Nov 13 16:13:16 2016
@@ -34,6 +34,7 @@ import org.eclipse.jface.dialogs.Message
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.text.ITextListener;
import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -46,19 +47,37 @@ import org.eclipse.ui.texteditor.IDocume
import org.apache.uima.taeconfigurator.editors.MultiPageEditor;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLEditor.
+ */
public class XMLEditor extends TextEditor {
+ /** The editor. */
MultiPageEditor editor;
+ /** The color manager. */
private ColorManager colorManager;
+ /** The m text listener. */
private EditorsTextListener m_textListener = new EditorsTextListener();
// next set to true when we are setting the text of the
// editor so that just switching to source page doesn't
+ /** The m b ignore text event. */
// cause editor to think source file is dirty
boolean m_bIgnoreTextEvent = false;
+ /**
+ * The listener interface for receiving editorsText events.
+ * The class that is interested in processing a editorsText
+ * event implements this interface, and the object created
+ * with that class is registered with a component using the
+ * component's <code>addEditorsTextListener</code> method. When
+ * the editorsText event occurs, that object's appropriate
+ * method is invoked.
+ *
+ */
public class EditorsTextListener implements ITextListener {
/*
@@ -66,6 +85,7 @@ public class XMLEditor extends TextEdito
*
* @see org.eclipse.jface.text.ITextListener#textChanged(org.eclipse.jface.text.TextEvent)
*/
+ @Override
public void textChanged(TextEvent event) {
if (!m_bIgnoreTextEvent) {
editor.sourceChanged = true;
@@ -74,6 +94,11 @@ public class XMLEditor extends TextEdito
}
}
+ /**
+ * Instantiates a new XML editor.
+ *
+ * @param editor the editor
+ */
public XMLEditor(MultiPageEditor editor) {
super();
colorManager = new ColorManager();
@@ -82,16 +107,28 @@ public class XMLEditor extends TextEdito
this.editor = editor;
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
getSourceViewer().addTextListener(m_textListener);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.editors.text.TextEditor#dispose()
+ */
+ @Override
public void dispose() {
colorManager.dispose();
super.dispose();
}
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#doSaveAs()
+ */
+ @Override
public void doSaveAs() {
IProgressMonitor progressMonitor = getProgressMonitor();
Shell shell = getSite().getShell();
@@ -118,7 +155,7 @@ public class XMLEditor extends TextEdito
dialog.setMessage(message, IMessageProvider.WARNING);
}
- if (dialog.open() == Dialog.CANCEL) {
+ if (dialog.open() == Window.CANCEL) {
if (progressMonitor != null)
progressMonitor.setCanceled(true);
editor.setSaveAsStatus(MultiPageEditor.SAVE_AS_CANCELLED);
@@ -138,6 +175,7 @@ public class XMLEditor extends TextEdito
final IEditorInput newInput = new FileEditorInput(file);
WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ @Override
public void execute(final IProgressMonitor monitor) throws CoreException {
getDocumentProvider().saveDocument(monitor, newInput,
getDocumentProvider().getDocument(getEditorInput()), true);
@@ -196,6 +234,11 @@ public class XMLEditor extends TextEdito
progressMonitor.setCanceled(!success);
}
+ /**
+ * Sets the ignore text event.
+ *
+ * @param bIgnoreTextEvent the new ignore text event
+ */
public void setIgnoreTextEvent(boolean bIgnoreTextEvent) {
m_bIgnoreTextEvent = bIgnoreTextEvent;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLPartitionScanner.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLPartitionScanner.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/xml/XMLPartitionScanner.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLPartitionScanner.java Sun Nov 13 16:13:16 2016
@@ -21,13 +21,24 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.text.rules.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLPartitionScanner.
+ */
public class XMLPartitionScanner extends RuleBasedPartitionScanner {
+
+ /** The Constant XML_DEFAULT. */
public final static String XML_DEFAULT = "__xml_default";
+ /** The Constant XML_COMMENT. */
public final static String XML_COMMENT = "__xml_comment";
+ /** The Constant XML_TAG. */
public final static String XML_TAG = "__xml_tag";
+ /**
+ * Instantiates a new XML partition scanner.
+ */
public XMLPartitionScanner() {
IToken xmlComment = new Token(XML_COMMENT);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLScanner.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLScanner.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/xml/XMLScanner.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLScanner.java Sun Nov 13 16:13:16 2016
@@ -22,8 +22,17 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.text.rules.*;
import org.eclipse.jface.text.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLScanner.
+ */
public class XMLScanner extends RuleBasedScanner {
+ /**
+ * Instantiates a new XML scanner.
+ *
+ * @param manager the manager
+ */
public XMLScanner(ColorManager manager) {
IToken procInstr = new Token(new TextAttribute(manager.getColor(IXMLColorConstants.PROC_INSTR)));
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLTagScanner.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLTagScanner.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/xml/XMLTagScanner.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLTagScanner.java Sun Nov 13 16:13:16 2016
@@ -22,8 +22,17 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.text.*;
import org.eclipse.jface.text.rules.*;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLTagScanner.
+ */
public class XMLTagScanner extends RuleBasedScanner {
+ /**
+ * Instantiates a new XML tag scanner.
+ *
+ * @param manager the manager
+ */
public XMLTagScanner(ColorManager manager) {
IToken string = new Token(new TextAttribute(manager.getColor(IXMLColorConstants.STRING)));
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLWhitespaceDetector.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLWhitespaceDetector.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/xml/XMLWhitespaceDetector.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/xml/XMLWhitespaceDetector.java Sun Nov 13 16:13:16 2016
@@ -21,8 +21,16 @@ package org.apache.uima.taeconfigurator.
import org.eclipse.jface.text.rules.IWhitespaceDetector;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class XMLWhitespaceDetector.
+ */
public class XMLWhitespaceDetector implements IWhitespaceDetector {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.text.rules.IWhitespaceDetector#isWhitespace(char)
+ */
+ @Override
public boolean isWhitespace(char c) {
return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/files/ContextForPartDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/files/ContextForPartDialog.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/files/ContextForPartDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/files/ContextForPartDialog.java Sun Nov 13 16:13:16 2016
@@ -41,19 +41,37 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ContextForPartDialog.
+ */
public class ContextForPartDialog extends /*LimitedResourceSelectionDialog*/
ResourcePickerDialog /*implements
ICheckStateListener*/ {
+ /** The context path GUI. */
// private MultiPageEditor editor;
private Text contextPathGUI;
+ /** The context path. */
public String contextPath;
+ /** The initial path. */
private String initialPath;
+ /** The tbe. */
private XMLizable tbe;
+ /**
+ * Instantiates a new context for part dialog.
+ *
+ * @param parentShell the parent shell
+ * @param rootElement the root element
+ * @param thingBeingEdited the thing being edited
+ * @param aExcludeDescriptor the a exclude descriptor
+ * @param aEditor the a editor
+ * @param aInitialPath the a initial path
+ */
public ContextForPartDialog(Shell parentShell, IAdaptable rootElement,
XMLizable thingBeingEdited, IPath aExcludeDescriptor, MultiPageEditor aEditor,
String aInitialPath) {
@@ -73,6 +91,10 @@ public class ContextForPartDialog extend
*/
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.taeconfigurator.editors.ui.dialogs.ResourcePickerDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
protected Control createDialogArea(Composite parent) {
parent = new Composite(parent, SWT.NONE);
parent.setLayout(new GridLayout(1, true));
@@ -123,6 +145,7 @@ public class ContextForPartDialog extend
/* (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);
@@ -134,6 +157,10 @@ public class ContextForPartDialog extend
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ @Override
protected void okPressed() {
contextPath = contextPathGUI.getText();
super.okPressed();
@@ -142,6 +169,7 @@ public class ContextForPartDialog extend
/* (non-Javadoc)
* @see org.apache.uima.taeconfigurator.editors.ui.dialogs.AbstractDialog#enableOK()
*/
+ @Override
public void enableOK() {
super.enableOK();
String path = contextPathGUI.getText();