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 2008/01/08 17:36:50 UTC
svn commit: r610059 [7/7] - in
/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor: ./
src/main/java/org/apache/uima/dde/internal/
src/main/java/org/apache/uima/dde/internal/details/
src/main/java/org/apache/uima/dde/internal/hover/ src/main/ja...
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection.java?rev=610059&r1=610058&r2=610059&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection.java Tue Jan 8 08:36:45 2008
@@ -1,292 +1,292 @@
-/*
- * Created on Dec 3, 2004
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.apache.uima.tools.internal.ui.forms;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.ColumnLayout;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-/**
- *
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-public class FormSection {
-
- public static class LabelAndObject {
- public Label label;
- public Object object;
- }
-
- public static Section createGridDataSection (FormToolkit toolkit, Composite parent,
- int sectionStyle, String title, String description,
- int marginWidth, int marginHeight,
- int layoutStyle, int horizontalSpan, int verticalSpan)
- {
- // Create Section
- Section section = toolkit.createSection(parent, sectionStyle);
- section.setText(title);
- section.setDescription(description);
- section.marginWidth = marginWidth;
- section.marginHeight = marginHeight;
- // toolkit.createCompositeSeparator(section);
-
- GridData layoutData = new GridData(layoutStyle);
- layoutData.horizontalSpan = horizontalSpan;
- layoutData.verticalSpan = verticalSpan;
- section.setLayoutData(layoutData);
-
- return section;
- } // createGridDataSection
-
- public static Section createTableWrapDataSection (FormToolkit toolkit, Composite parent,
- int sectionStyle, String title, String description,
- int marginWidth, int marginHeight,
- int align, int valign, int rowspan, int colspan)
- {
- // Create Section
- Section section = toolkit.createSection(parent, sectionStyle);
- section.setText(title);
- section.setDescription(description);
- section.marginWidth = marginWidth;
- section.marginHeight = marginHeight;
- toolkit.createCompositeSeparator(section);
-
- TableWrapData layoutData = new TableWrapData(align, valign, rowspan, colspan);
- layoutData.grabHorizontal = true;
- layoutData.grabVertical = true;
- section.setLayoutData(layoutData);
-
-// final SectionPart spart = new SectionPart(section);
-// mform.addPart(spart);
-// spart.initialize (mform); // Need this code. Otherwise, exception in SectionPart !!!
-
- return section;
- } // createTableWrapDataSection
-
- public static Label createLabelAndLabel (FormToolkit toolkit, Composite parent,
- String labelText, String textText, int textWidthHint, int textHeightHint)
- {
- Label label = toolkit.createLabel(parent, labelText);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Label text = toolkit.createLabel(parent, textText); //$NON-NLS-1$
-
- FormSection.fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint);
-
- return text;
- } // createLabelAndLabel
-
- public static Text createLabelAndText (FormToolkit toolkit, Composite parent,
- String labelText, String textText, int style, int textWidthHint, int textHeightHint)
- {
- Label label = toolkit.createLabel(parent, labelText);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Text text = toolkit.createText(parent, textText, style); //$NON-NLS-1$
-
- FormSection.fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint);
-
- return text;
- } // createLabelAndText
-
- public static Text createLabelAndText (FormToolkit toolkit, Composite parent,
- Label label, String textText, int style, int textWidthHint, int textHeightHint)
- {
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Text text = toolkit.createText(parent, textText, style); //$NON-NLS-1$
-
- FormSection.fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint);
-
- return text;
- } // createLabelAndText
-
- public static CCombo createLabelAndCCombo (FormToolkit toolkit, Composite parent,
- String labelText, int style)
- {
- Label label = toolkit.createLabel(parent, labelText);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- CCombo ccombo = new CCombo (parent, style);
- toolkit.adapt(ccombo);
-
- FormSection.fillIntoGridOrTableLayout (parent, label, ccombo, 10, 0);
-
- return ccombo;
- } // createLabelAndCCombo
-
- public static void fillIntoGridLayout (Composite parent,
- Label label, Control control,
- int widthHint, int heightHint)
- {
- Layout layout = parent.getLayout();
- if (layout instanceof GridLayout) {
- GridData gd;
- int span = ((GridLayout) layout).numColumns;
- int tspan = span - 1;
- gd = new GridData();
- if (control != null && (control.getStyle() & SWT.MULTI) > 0 ) {
- gd.verticalAlignment = SWT.BEGINNING;
- } else {
- gd.verticalAlignment = SWT.CENTER;
- }
- if (control == null) {
- gd.horizontalSpan = tspan;
- }
- label.setLayoutData(gd);
-
- if (control != null) {
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- gd.horizontalSpan = tspan;
- gd.grabExcessHorizontalSpace = (tspan == 1);
- gd.widthHint = widthHint;
- // gd.verticalIndent = 4;
- if (control != null && (control.getStyle() & SWT.MULTI) > 0 ) {
- gd.heightHint = heightHint;
- }
- control.setLayoutData(gd);
- }
- }
- } // fillIntoGridLayout
-
- public static void fillIntoTableLayout (Composite parent,
- Label label, Control control, int heightHint)
- {
- Layout layout = parent.getLayout();
-
- if (layout instanceof TableWrapLayout) {
- TableWrapData td;
- int span = ((TableWrapLayout) layout).numColumns;
- int tspan = span - 1;
- td = new TableWrapData();
- td.valign = TableWrapData.TOP; // MIDDLE;
- if (control == null) {
- td.colspan = tspan;
- }
- label.setLayoutData(td);
-
- if (control != null) {
- td = new TableWrapData(TableWrapData.FILL);
- td.colspan = tspan;
- td.grabHorizontal = (tspan == 1);
- if (heightHint > 0) {
- td.heightHint = heightHint;
- }
- control.setLayoutData(td);
- }
- }
- } // fillIntoTableLayout
-
- public static void fillIntoGridOrTableLayout (Composite parent,
- Label label, Control control,
- int widthHint, int heightHint)
- {
- Layout layout = parent.getLayout();
- if (layout instanceof GridLayout) {
- fillIntoGridLayout (parent, label, control, widthHint, heightHint);
- } else if (layout instanceof TableWrapLayout) {
- fillIntoTableLayout (parent, label, control, heightHint);
- }
- } // fillIntoGridOrTableLayout
-
- public static Composite createColumnLayoutContainer ( FormToolkit toolkit, Composite parent,
- int minNumColumns, int maxNumColumns )
- {
- Composite container = toolkit.createComposite(parent, SWT.WRAP);
- ColumnLayout layout = new ColumnLayout();
- layout.minNumColumns = minNumColumns;
- layout.maxNumColumns = maxNumColumns;
- container.setLayout(layout);
- // toolkit.paintBordersFor(container);
-
- return container;
- } // createColumnLayoutContainer
-
- public static Composite createGridLayoutContainer ( FormToolkit toolkit, Composite parent,
- int numColumns, int marginWidth, int marginHeight )
- {
- Composite container = toolkit.createComposite(parent, SWT.WRAP);
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = marginWidth;
- layout.marginHeight = marginHeight;
- container.setLayout(layout);
- // toolkit.paintBordersFor(container);
-
- return container;
- } // createGridLayoutContainer
-
- public static ScrolledComposite createGridLayoutScrolledContainer ( FormToolkit toolkit, Composite parent,
- int numColumns, int marginWidth, int marginHeight )
- {
- // Composite container = toolkit.createComposite(parent, SWT.WRAP);
- ScrolledComposite container = new ScrolledComposite(parent,
- SWT.WRAP|SWT.V_SCROLL|SWT.H_SCROLL);
- toolkit.adapt(container);
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = marginWidth;
- layout.marginHeight = marginHeight;
- container.setLayout(layout);
-// toolkit.paintBordersFor(container);
-
- return container;
- } // createGridLayoutContainer
-
-
- public static Composite createTableLayoutContainer ( FormToolkit toolkit, Composite parent,
- int numColumns, boolean makeColumnsEqualWidth,
- int topMargin, int bottomMargin,
- int leftMargin, int rightMargin)
- {
- Composite container = toolkit.createComposite(parent);
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = numColumns;
- layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
- layout.topMargin = topMargin;
- layout.bottomMargin = bottomMargin;
- layout.leftMargin = leftMargin;
- layout.rightMargin = rightMargin;
-
- container.setLayout(layout);
-
- return container;
- } // createTableLayoutContainer
-
- public static ScrolledComposite createTableLayoutScrolledContainer ( FormToolkit toolkit, Composite parent,
- int numColumns, boolean makeColumnsEqualWidth,
- int topMargin, int bottomMargin,
- int leftMargin, int rightMargin)
- {
-// Composite container = toolkit.createComposite(parent);
- ScrolledComposite container = new ScrolledComposite(parent, SWT.WRAP|SWT.V_SCROLL);
- toolkit.adapt(container);
- TableWrapLayout layout = new TableWrapLayout();
- layout.numColumns = numColumns;
- layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
- layout.topMargin = topMargin;
- layout.bottomMargin = bottomMargin;
- layout.leftMargin = leftMargin;
- layout.rightMargin = rightMargin;
-
- container.setLayout(layout);
-
- return container;
- } // createTableLayoutScrolledContainer
-
-}
+/*
+ * Created on Dec 3, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.uima.tools.internal.ui.forms;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ *
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class FormSection {
+
+ public static class LabelAndObject {
+ public Label label;
+ public Object object;
+ }
+
+ public static Section createGridDataSection (FormToolkit toolkit, Composite parent,
+ int sectionStyle, String title, String description,
+ int marginWidth, int marginHeight,
+ int layoutStyle, int horizontalSpan, int verticalSpan)
+ {
+ // Create Section
+ Section section = toolkit.createSection(parent, sectionStyle);
+ section.setText(title);
+ section.setDescription(description);
+ section.marginWidth = marginWidth;
+ section.marginHeight = marginHeight;
+ // toolkit.createCompositeSeparator(section);
+
+ GridData layoutData = new GridData(layoutStyle);
+ layoutData.horizontalSpan = horizontalSpan;
+ layoutData.verticalSpan = verticalSpan;
+ section.setLayoutData(layoutData);
+
+ return section;
+ } // createGridDataSection
+
+ public static Section createTableWrapDataSection (FormToolkit toolkit, Composite parent,
+ int sectionStyle, String title, String description,
+ int marginWidth, int marginHeight,
+ int align, int valign, int rowspan, int colspan)
+ {
+ // Create Section
+ Section section = toolkit.createSection(parent, sectionStyle);
+ section.setText(title);
+ section.setDescription(description);
+ section.marginWidth = marginWidth;
+ section.marginHeight = marginHeight;
+ toolkit.createCompositeSeparator(section);
+
+ TableWrapData layoutData = new TableWrapData(align, valign, rowspan, colspan);
+ layoutData.grabHorizontal = true;
+ layoutData.grabVertical = true;
+ section.setLayoutData(layoutData);
+
+// final SectionPart spart = new SectionPart(section);
+// mform.addPart(spart);
+// spart.initialize (mform); // Need this code. Otherwise, exception in SectionPart !!!
+
+ return section;
+ } // createTableWrapDataSection
+
+ public static Label createLabelAndLabel (FormToolkit toolkit, Composite parent,
+ String labelText, String textText, int textWidthHint, int textHeightHint)
+ {
+ Label label = toolkit.createLabel(parent, labelText);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Label text = toolkit.createLabel(parent, textText); //$NON-NLS-1$
+
+ FormSection.fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint);
+
+ return text;
+ } // createLabelAndLabel
+
+ public static Text createLabelAndText (FormToolkit toolkit, Composite parent,
+ String labelText, String textText, int style, int textWidthHint, int textHeightHint)
+ {
+ Label label = toolkit.createLabel(parent, labelText);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Text text = toolkit.createText(parent, textText, style); //$NON-NLS-1$
+
+ FormSection.fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint);
+
+ return text;
+ } // createLabelAndText
+
+ public static Text createLabelAndText (FormToolkit toolkit, Composite parent,
+ Label label, String textText, int style, int textWidthHint, int textHeightHint)
+ {
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Text text = toolkit.createText(parent, textText, style); //$NON-NLS-1$
+
+ FormSection.fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint);
+
+ return text;
+ } // createLabelAndText
+
+ public static CCombo createLabelAndCCombo (FormToolkit toolkit, Composite parent,
+ String labelText, int style)
+ {
+ Label label = toolkit.createLabel(parent, labelText);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ CCombo ccombo = new CCombo (parent, style);
+ toolkit.adapt(ccombo);
+
+ FormSection.fillIntoGridOrTableLayout (parent, label, ccombo, 10, 0);
+
+ return ccombo;
+ } // createLabelAndCCombo
+
+ public static void fillIntoGridLayout (Composite parent,
+ Label label, Control control,
+ int widthHint, int heightHint)
+ {
+ Layout layout = parent.getLayout();
+ if (layout instanceof GridLayout) {
+ GridData gd;
+ int span = ((GridLayout) layout).numColumns;
+ int tspan = span - 1;
+ gd = new GridData();
+ if (control != null && (control.getStyle() & SWT.MULTI) > 0 ) {
+ gd.verticalAlignment = SWT.BEGINNING;
+ } else {
+ gd.verticalAlignment = SWT.CENTER;
+ }
+ if (control == null) {
+ gd.horizontalSpan = tspan;
+ }
+ label.setLayoutData(gd);
+
+ if (control != null) {
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ gd.horizontalSpan = tspan;
+ gd.grabExcessHorizontalSpace = (tspan == 1);
+ gd.widthHint = widthHint;
+ // gd.verticalIndent = 4;
+ if (control != null && (control.getStyle() & SWT.MULTI) > 0 ) {
+ gd.heightHint = heightHint;
+ }
+ control.setLayoutData(gd);
+ }
+ }
+ } // fillIntoGridLayout
+
+ public static void fillIntoTableLayout (Composite parent,
+ Label label, Control control, int heightHint)
+ {
+ Layout layout = parent.getLayout();
+
+ if (layout instanceof TableWrapLayout) {
+ TableWrapData td;
+ int span = ((TableWrapLayout) layout).numColumns;
+ int tspan = span - 1;
+ td = new TableWrapData();
+ td.valign = TableWrapData.TOP; // MIDDLE;
+ if (control == null) {
+ td.colspan = tspan;
+ }
+ label.setLayoutData(td);
+
+ if (control != null) {
+ td = new TableWrapData(TableWrapData.FILL);
+ td.colspan = tspan;
+ td.grabHorizontal = (tspan == 1);
+ if (heightHint > 0) {
+ td.heightHint = heightHint;
+ }
+ control.setLayoutData(td);
+ }
+ }
+ } // fillIntoTableLayout
+
+ public static void fillIntoGridOrTableLayout (Composite parent,
+ Label label, Control control,
+ int widthHint, int heightHint)
+ {
+ Layout layout = parent.getLayout();
+ if (layout instanceof GridLayout) {
+ fillIntoGridLayout (parent, label, control, widthHint, heightHint);
+ } else if (layout instanceof TableWrapLayout) {
+ fillIntoTableLayout (parent, label, control, heightHint);
+ }
+ } // fillIntoGridOrTableLayout
+
+ public static Composite createColumnLayoutContainer ( FormToolkit toolkit, Composite parent,
+ int minNumColumns, int maxNumColumns )
+ {
+ Composite container = toolkit.createComposite(parent, SWT.WRAP);
+ ColumnLayout layout = new ColumnLayout();
+ layout.minNumColumns = minNumColumns;
+ layout.maxNumColumns = maxNumColumns;
+ container.setLayout(layout);
+ // toolkit.paintBordersFor(container);
+
+ return container;
+ } // createColumnLayoutContainer
+
+ public static Composite createGridLayoutContainer ( FormToolkit toolkit, Composite parent,
+ int numColumns, int marginWidth, int marginHeight )
+ {
+ Composite container = toolkit.createComposite(parent, SWT.WRAP);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = numColumns;
+ layout.marginWidth = marginWidth;
+ layout.marginHeight = marginHeight;
+ container.setLayout(layout);
+ // toolkit.paintBordersFor(container);
+
+ return container;
+ } // createGridLayoutContainer
+
+ public static ScrolledComposite createGridLayoutScrolledContainer ( FormToolkit toolkit, Composite parent,
+ int numColumns, int marginWidth, int marginHeight )
+ {
+ // Composite container = toolkit.createComposite(parent, SWT.WRAP);
+ ScrolledComposite container = new ScrolledComposite(parent,
+ SWT.WRAP|SWT.V_SCROLL|SWT.H_SCROLL);
+ toolkit.adapt(container);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = numColumns;
+ layout.marginWidth = marginWidth;
+ layout.marginHeight = marginHeight;
+ container.setLayout(layout);
+// toolkit.paintBordersFor(container);
+
+ return container;
+ } // createGridLayoutContainer
+
+
+ public static Composite createTableLayoutContainer ( FormToolkit toolkit, Composite parent,
+ int numColumns, boolean makeColumnsEqualWidth,
+ int topMargin, int bottomMargin,
+ int leftMargin, int rightMargin)
+ {
+ Composite container = toolkit.createComposite(parent);
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.numColumns = numColumns;
+ layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
+ layout.topMargin = topMargin;
+ layout.bottomMargin = bottomMargin;
+ layout.leftMargin = leftMargin;
+ layout.rightMargin = rightMargin;
+
+ container.setLayout(layout);
+
+ return container;
+ } // createTableLayoutContainer
+
+ public static ScrolledComposite createTableLayoutScrolledContainer ( FormToolkit toolkit, Composite parent,
+ int numColumns, boolean makeColumnsEqualWidth,
+ int topMargin, int bottomMargin,
+ int leftMargin, int rightMargin)
+ {
+// Composite container = toolkit.createComposite(parent);
+ ScrolledComposite container = new ScrolledComposite(parent, SWT.WRAP|SWT.V_SCROLL);
+ toolkit.adapt(container);
+ TableWrapLayout layout = new TableWrapLayout();
+ layout.numColumns = numColumns;
+ layout.makeColumnsEqualWidth = makeColumnsEqualWidth;
+ layout.topMargin = topMargin;
+ layout.bottomMargin = bottomMargin;
+ layout.leftMargin = leftMargin;
+ layout.rightMargin = rightMargin;
+
+ container.setLayout(layout);
+
+ return container;
+ } // createTableLayoutScrolledContainer
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection2.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection2.java?rev=610059&r1=610058&r2=610059&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection2.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection2.java Tue Jan 8 08:36:45 2008
@@ -1,256 +1,256 @@
-package org.apache.uima.tools.internal.ui.forms;
-
-import org.apache.uima.tools.debug.util.Trace;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Layout;
-import org.eclipse.swt.widgets.Spinner;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-
-public class FormSection2 extends FormSection {
-
- public static final int MAX_DECORATION_WIDTH = 8; // Bug in 3.2, Fixed in 3.3
- /*
- * Image id's for JFace
- */
- private static final String IMG_DEC_FIELD_CONTENT_PROPOSAL = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_CONTENT_PROPOSAL"; //$NON-NLS-1$
-
- private static final String IMG_DEC_FIELD_REQUIRED = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_REQUIRED"; //$NON-NLS-1$
-
- private static final String IMG_DEC_FIELD_ERROR = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_ERROR"; //$NON-NLS-1$
-
- private static final String IMG_DEC_FIELD_WARNING = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_WARNING"; //$NON-NLS-1$
-
- /***************************************************************************/
-
- static protected void registerFieldDecoration (String id, String description, String imageId) {
- FieldDecorationRegistry.getDefault().registerFieldDecoration(id, description,
- imageId, JFaceResources.getImageRegistry());
- }
-
- static public FieldDecoration registerFieldDecoration(String id, String description) {
- registerFieldDecoration(id, description, IMG_DEC_FIELD_ERROR);
-
- // FieldDecoration deco = FieldDecorationRegistry.getDefault().getFieldDecoration(id);
- // Trace.err("Width max: " + FieldDecorationRegistry.getDefault().getMaximumDecorationWidth());
- // return deco;
-
- return FieldDecorationRegistry.getDefault().getFieldDecoration(id);
- }
-
- public static DecoratedField createLabelAndDecoratedText (final FormToolkit toolkit, Composite parent,
- String labelText, String textText, int style, int textWidthHint, int textHeightHint)
- {
- Label label = toolkit.createLabel(parent, labelText);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
-
- DecoratedField field = new DecoratedField(parent, style, new IControlCreator() {
-
- public Control createControl(Composite parent1, int controlStyle) {
- Text t = toolkit.createText(parent1, "", controlStyle);
- return t;
- }
- });
- ((Text) field.getControl()).setText(textText);
- toolkit.adapt(field.getLayoutControl(), false, false);
-
- FormSection.fillIntoGridOrTableLayout (parent, label, field.getLayoutControl(), textWidthHint, textHeightHint);
-
- return field;
- } // createLabelAndDecoratedText
-
- public static DecoratedField createLabelAndGridLayoutDecoratedContainer (final FormToolkit toolkit, Composite parent,
- String labelText, int numColumns, int marginWidth, int marginHeight )
- {
- Label label = toolkit.createLabel(parent, labelText);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
-
- DecoratedField field = new DecoratedField(parent, SWT.WRAP, new IControlCreator() {
-
- public Control createControl(Composite parent1, int controlStyle) {
- Composite container = toolkit.createComposite(parent1, controlStyle);
- return container;
- }
- });
- Composite container = (Composite) field.getControl();
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- layout.marginWidth = marginWidth;
- layout.marginHeight = marginHeight;
- container.setLayout(layout);
- toolkit.adapt(field.getLayoutControl(), false, false);
-
- FormSection.fillIntoGridOrTableLayout (parent, label, field.getLayoutControl(), 0, 0);
-
- return field;
- } // createLabelAndGridLayoutDecoratedContainer
-
-
- /***************************************************************************/
-
- /**
- * Support left indentation
- *
- * @param toolkit
- * @param parent
- * @param labelText
- * @param textText
- * @param textWidthHint
- * @param textHeightHint
- * @param indentLeft
- * @return Label
- */
- public static Label createLabelAndLabel (FormToolkit toolkit, Composite parent,
- String labelText, String textText, int textWidthHint, int textHeightHint,
- int indentLeft)
- {
- Label label = toolkit.createLabel(parent, labelText);
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Label text = toolkit.createLabel(parent, textText); //$NON-NLS-1$
-
- fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint,
- false, indentLeft);
-
- return text;
- } // createLabelAndLabel
-
- /***************************************************************************/
-
- static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent,
- String labelText, int style, int min, int max, boolean grabH) {
- return createLabelAndSpinner(toolkit, parent, labelText, style, min, max, grabH, 0);
- }
-
- static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent,
- String labelText, int style, int min, int max, boolean grabH, int indentLeft) {
- Label label = toolkit.createLabel(parent, labelText);
- return createLabelAndSpinner(toolkit, parent, label, style, min, max, grabH, indentLeft);
- }
-
- static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent,
- Label label, int style, int min, int max, boolean grabH) {
- return createLabelAndSpinner(toolkit, parent, label, style, min, max, grabH, 0);
- }
-
- static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent, Label label,
- int style, int min, int max, boolean grabH, int indentLeft) {
- label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
- Spinner control = new Spinner(parent, style);
- toolkit.adapt(control, false, false);
- control.setMinimum(min);
- control.setMaximum(max);
- fillIntoGridOrTableLayout(parent, label, control, 20, 0, grabH, indentLeft);
-
- return control;
- }
-
- /***************************************************************************/
-
- public static void fillIntoGridLayout(Composite parent, Label label, Control control,
- int widthHint, int heightHint, boolean grabH, int indentLeft) {
- Layout layout = parent.getLayout();
- if (layout instanceof GridLayout) {
- GridData gd;
- int span = ((GridLayout) layout).numColumns;
- int colspan = span - 1;
- gd = new GridData();
- if (control != null && (control.getStyle() & SWT.MULTI) > 0) {
- gd.verticalAlignment = SWT.BEGINNING;
- } else {
- gd.verticalAlignment = SWT.CENTER;
- }
- label.setLayoutData(gd);
- if (control == null) {
- gd.horizontalSpan = colspan;
- } else {
- // Set LayoutData for Control
- if (grabH) {
- gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- } else {
- gd = new GridData();
- }
- if (indentLeft > 0) {
- // Set indent
- gd.horizontalIndent = indentLeft;
- }
- gd.horizontalSpan = colspan;
- if (grabH) {
- // Grab horizontal ONLY when colspan is 1 (i.e., 2 colums)
- gd.grabExcessHorizontalSpace = (colspan == 1);
- } else {
- gd.grabExcessHorizontalSpace = false;
- }
- gd.widthHint = widthHint;
- // gd.verticalIndent = 4;
- if (control != null && (control.getStyle() & SWT.MULTI) > 0) {
- gd.heightHint = heightHint;
- }
- control.setLayoutData(gd);
- }
- }
- } // fillIntoGridLayout
-
- public static void fillIntoTableLayout(Composite parent, Label label, Control control,
- int heightHint, boolean grabH, int indentLeft) {
- Layout layout = parent.getLayout();
-
- if (layout instanceof TableWrapLayout) {
- TableWrapData td;
- int span = ((TableWrapLayout) layout).numColumns;
- int colspan = span - 1;
- td = new TableWrapData();
- td.valign = TableWrapData.TOP; // MIDDLE;
- label.setLayoutData(td);
- if (control == null) {
- td.colspan = colspan;
- } else {
- // Set LayoutData for Control
- if (grabH) {
- td = new TableWrapData(TableWrapData.FILL);
- } else {
- td = new TableWrapData();
- }
- if (indentLeft > 0) {
- // Set indent
- td.indent = indentLeft;
- }
- td.colspan = colspan;
- if (grabH) {
- // Grab horizontal ONLY when colspan is 1 (i.e., 2 colums)
- td.grabHorizontal = (colspan == 1);
- } else {
- td.grabHorizontal = false;
- }
- if (heightHint > 0) {
- td.heightHint = heightHint;
- }
- control.setLayoutData(td);
- }
- }
- } // fillIntoTableLayout
-
- public static void fillIntoGridOrTableLayout(Composite parent, Label label, Control control,
- int widthHint, int heightHint, boolean grabH, int indentLeft) {
- Layout layout = parent.getLayout();
- if (layout instanceof GridLayout) {
- fillIntoGridLayout(parent, label, control, widthHint, heightHint, grabH, indentLeft);
- } else if (layout instanceof TableWrapLayout) {
- fillIntoTableLayout(parent, label, control, heightHint, grabH, indentLeft);
- }
- } // fillIntoGridOrTableLayout
-
-}
+package org.apache.uima.tools.internal.ui.forms;
+
+import org.apache.uima.tools.debug.util.Trace;
+import org.eclipse.jface.fieldassist.DecoratedField;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.fieldassist.IControlCreator;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Layout;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.FormColors;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+
+public class FormSection2 extends FormSection {
+
+ public static final int MAX_DECORATION_WIDTH = 8; // Bug in 3.2, Fixed in 3.3
+ /*
+ * Image id's for JFace
+ */
+ private static final String IMG_DEC_FIELD_CONTENT_PROPOSAL = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_CONTENT_PROPOSAL"; //$NON-NLS-1$
+
+ private static final String IMG_DEC_FIELD_REQUIRED = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_REQUIRED"; //$NON-NLS-1$
+
+ private static final String IMG_DEC_FIELD_ERROR = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_ERROR"; //$NON-NLS-1$
+
+ private static final String IMG_DEC_FIELD_WARNING = "org.eclipse.jface.fieldassist.IMG_DEC_FIELD_WARNING"; //$NON-NLS-1$
+
+ /***************************************************************************/
+
+ static protected void registerFieldDecoration (String id, String description, String imageId) {
+ FieldDecorationRegistry.getDefault().registerFieldDecoration(id, description,
+ imageId, JFaceResources.getImageRegistry());
+ }
+
+ static public FieldDecoration registerFieldDecoration(String id, String description) {
+ registerFieldDecoration(id, description, IMG_DEC_FIELD_ERROR);
+
+ // FieldDecoration deco = FieldDecorationRegistry.getDefault().getFieldDecoration(id);
+ // Trace.err("Width max: " + FieldDecorationRegistry.getDefault().getMaximumDecorationWidth());
+ // return deco;
+
+ return FieldDecorationRegistry.getDefault().getFieldDecoration(id);
+ }
+
+ public static DecoratedField createLabelAndDecoratedText (final FormToolkit toolkit, Composite parent,
+ String labelText, String textText, int style, int textWidthHint, int textHeightHint)
+ {
+ Label label = toolkit.createLabel(parent, labelText);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+
+ DecoratedField field = new DecoratedField(parent, style, new IControlCreator() {
+
+ public Control createControl(Composite parent1, int controlStyle) {
+ Text t = toolkit.createText(parent1, "", controlStyle);
+ return t;
+ }
+ });
+ ((Text) field.getControl()).setText(textText);
+ toolkit.adapt(field.getLayoutControl(), false, false);
+
+ FormSection.fillIntoGridOrTableLayout (parent, label, field.getLayoutControl(), textWidthHint, textHeightHint);
+
+ return field;
+ } // createLabelAndDecoratedText
+
+ public static DecoratedField createLabelAndGridLayoutDecoratedContainer (final FormToolkit toolkit, Composite parent,
+ String labelText, int numColumns, int marginWidth, int marginHeight )
+ {
+ Label label = toolkit.createLabel(parent, labelText);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+
+ DecoratedField field = new DecoratedField(parent, SWT.WRAP, new IControlCreator() {
+
+ public Control createControl(Composite parent1, int controlStyle) {
+ Composite container = toolkit.createComposite(parent1, controlStyle);
+ return container;
+ }
+ });
+ Composite container = (Composite) field.getControl();
+ GridLayout layout = new GridLayout();
+ layout.numColumns = numColumns;
+ layout.marginWidth = marginWidth;
+ layout.marginHeight = marginHeight;
+ container.setLayout(layout);
+ toolkit.adapt(field.getLayoutControl(), false, false);
+
+ FormSection.fillIntoGridOrTableLayout (parent, label, field.getLayoutControl(), 0, 0);
+
+ return field;
+ } // createLabelAndGridLayoutDecoratedContainer
+
+
+ /***************************************************************************/
+
+ /**
+ * Support left indentation
+ *
+ * @param toolkit
+ * @param parent
+ * @param labelText
+ * @param textText
+ * @param textWidthHint
+ * @param textHeightHint
+ * @param indentLeft
+ * @return Label
+ */
+ public static Label createLabelAndLabel (FormToolkit toolkit, Composite parent,
+ String labelText, String textText, int textWidthHint, int textHeightHint,
+ int indentLeft)
+ {
+ Label label = toolkit.createLabel(parent, labelText);
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Label text = toolkit.createLabel(parent, textText); //$NON-NLS-1$
+
+ fillIntoGridOrTableLayout (parent, label, text, textWidthHint, textHeightHint,
+ false, indentLeft);
+
+ return text;
+ } // createLabelAndLabel
+
+ /***************************************************************************/
+
+ static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent,
+ String labelText, int style, int min, int max, boolean grabH) {
+ return createLabelAndSpinner(toolkit, parent, labelText, style, min, max, grabH, 0);
+ }
+
+ static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent,
+ String labelText, int style, int min, int max, boolean grabH, int indentLeft) {
+ Label label = toolkit.createLabel(parent, labelText);
+ return createLabelAndSpinner(toolkit, parent, label, style, min, max, grabH, indentLeft);
+ }
+
+ static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent,
+ Label label, int style, int min, int max, boolean grabH) {
+ return createLabelAndSpinner(toolkit, parent, label, style, min, max, grabH, 0);
+ }
+
+ static public Spinner createLabelAndSpinner(FormToolkit toolkit, Composite parent, Label label,
+ int style, int min, int max, boolean grabH, int indentLeft) {
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
+ Spinner control = new Spinner(parent, style);
+ toolkit.adapt(control, false, false);
+ control.setMinimum(min);
+ control.setMaximum(max);
+ fillIntoGridOrTableLayout(parent, label, control, 20, 0, grabH, indentLeft);
+
+ return control;
+ }
+
+ /***************************************************************************/
+
+ public static void fillIntoGridLayout(Composite parent, Label label, Control control,
+ int widthHint, int heightHint, boolean grabH, int indentLeft) {
+ Layout layout = parent.getLayout();
+ if (layout instanceof GridLayout) {
+ GridData gd;
+ int span = ((GridLayout) layout).numColumns;
+ int colspan = span - 1;
+ gd = new GridData();
+ if (control != null && (control.getStyle() & SWT.MULTI) > 0) {
+ gd.verticalAlignment = SWT.BEGINNING;
+ } else {
+ gd.verticalAlignment = SWT.CENTER;
+ }
+ label.setLayoutData(gd);
+ if (control == null) {
+ gd.horizontalSpan = colspan;
+ } else {
+ // Set LayoutData for Control
+ if (grabH) {
+ gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
+ } else {
+ gd = new GridData();
+ }
+ if (indentLeft > 0) {
+ // Set indent
+ gd.horizontalIndent = indentLeft;
+ }
+ gd.horizontalSpan = colspan;
+ if (grabH) {
+ // Grab horizontal ONLY when colspan is 1 (i.e., 2 colums)
+ gd.grabExcessHorizontalSpace = (colspan == 1);
+ } else {
+ gd.grabExcessHorizontalSpace = false;
+ }
+ gd.widthHint = widthHint;
+ // gd.verticalIndent = 4;
+ if (control != null && (control.getStyle() & SWT.MULTI) > 0) {
+ gd.heightHint = heightHint;
+ }
+ control.setLayoutData(gd);
+ }
+ }
+ } // fillIntoGridLayout
+
+ public static void fillIntoTableLayout(Composite parent, Label label, Control control,
+ int heightHint, boolean grabH, int indentLeft) {
+ Layout layout = parent.getLayout();
+
+ if (layout instanceof TableWrapLayout) {
+ TableWrapData td;
+ int span = ((TableWrapLayout) layout).numColumns;
+ int colspan = span - 1;
+ td = new TableWrapData();
+ td.valign = TableWrapData.TOP; // MIDDLE;
+ label.setLayoutData(td);
+ if (control == null) {
+ td.colspan = colspan;
+ } else {
+ // Set LayoutData for Control
+ if (grabH) {
+ td = new TableWrapData(TableWrapData.FILL);
+ } else {
+ td = new TableWrapData();
+ }
+ if (indentLeft > 0) {
+ // Set indent
+ td.indent = indentLeft;
+ }
+ td.colspan = colspan;
+ if (grabH) {
+ // Grab horizontal ONLY when colspan is 1 (i.e., 2 colums)
+ td.grabHorizontal = (colspan == 1);
+ } else {
+ td.grabHorizontal = false;
+ }
+ if (heightHint > 0) {
+ td.heightHint = heightHint;
+ }
+ control.setLayoutData(td);
+ }
+ }
+ } // fillIntoTableLayout
+
+ public static void fillIntoGridOrTableLayout(Composite parent, Label label, Control control,
+ int widthHint, int heightHint, boolean grabH, int indentLeft) {
+ Layout layout = parent.getLayout();
+ if (layout instanceof GridLayout) {
+ fillIntoGridLayout(parent, label, control, widthHint, heightHint, grabH, indentLeft);
+ } else if (layout instanceof TableWrapLayout) {
+ fillIntoTableLayout(parent, label, control, heightHint, grabH, indentLeft);
+ }
+ } // fillIntoGridOrTableLayout
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/ui/forms/FormSection2.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java?rev=610059&r1=610058&r2=610059&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java Tue Jan 8 08:36:45 2008
@@ -1,296 +1,296 @@
-package org.apache.uima.tools.internal.uima.util;
-
-import org.apache.uima.ResourceSpecifierFactory;
-import org.apache.uima.UIMAFramework;
-import org.apache.uima.aae.deployment.AEDeploymentMetaData;
-import org.apache.uima.aae.deployment.AsyncAEErrorConfiguration;
-import org.apache.uima.aae.deployment.RemoteAEDeploymentMetaData;
-import org.apache.uima.aae.deployment.impl.AsyncAggregateErrorConfiguration_Impl;
-import org.apache.uima.aae.deployment.impl.AsyncPrimitiveErrorConfiguration_Impl;
-import org.apache.uima.aae.deployment.impl.DeploymentMetaData_Impl;
-import org.apache.uima.aae.deployment.impl.GetMetadataErrors_Impl;
-import org.apache.uima.analysis_engine.AnalysisEngineDescription;
-import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
-import org.apache.uima.resource.ResourceSpecifier;
-import org.apache.uima.resource.metadata.Import;
-import org.apache.uima.resource.metadata.OperationalProperties;
-import org.apache.uima.tools.debug.util.Trace;
-import org.apache.uima.util.InvalidXMLException;
-
-
-public class AETreeBuilder {
-
- static public Import createImport(String descriptor, boolean byLocation) {
- Import imp = (Import) UIMAFramework.getResourceSpecifierFactory().createObject(Import.class);
- if (byLocation) {
- imp.setLocation(descriptor);
- } else {
- imp.setName(descriptor);
- }
-
- return imp;
- }
-
- static public AEDeploymentMetaData createAEDeploymentMetaData(
- RemoteAEDeploymentMetaData remoteMetaData) {
- ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory();
- AEDeploymentMetaData metaData = (AEDeploymentMetaData) factory
- .createObject(AEDeploymentMetaData.class);
- metaData.setParent(remoteMetaData.getParent());
- metaData.setKey(remoteMetaData.getKey());
- try {
- metaData.setResourceSpecifier(remoteMetaData.getResourceSpecifier(), null, false);
- } catch (InvalidXMLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // Need to call AFTER metaData.setResourceSpecifier
- metaData.setCasMultiplierPoolSize(remoteMetaData.getCasMultiplierPoolSize());
-
- // Clone OR Create a new AsyncPrimitiveErrorConfiguration
-// ResourceSpecifier rs = remoteMetaData.getResourceSpecifier();
- boolean isPrimitive = false;
-// if (rs instanceof AnalysisEngineDescription) {
-// isPrimitive = ((AnalysisEngineDescription) rs).isPrimitive();
-// } else {
-// // Exception ???
-// }
- if (isPrimitive) {
- // Create a new AsyncPrimitiveErrorConfiguration
- AsyncAEErrorConfiguration remoteErrorConfig = remoteMetaData.getAsyncAEErrorConfiguration();
- AsyncAEErrorConfiguration primitiveErrorConfig = new AsyncPrimitiveErrorConfiguration_Impl();
- primitiveErrorConfig.setProcessCasErrors(remoteErrorConfig.getProcessCasErrors().clone(
- primitiveErrorConfig));
- primitiveErrorConfig.setCollectionProcessCompleteErrors(remoteErrorConfig
- .getCollectionProcessCompleteErrors().clone(primitiveErrorConfig));
- metaData.setAsyncAEErrorConfiguration(primitiveErrorConfig);
- } else {
- // Clone
- metaData.setAsyncAEErrorConfiguration((AsyncAEErrorConfiguration) remoteMetaData
- .getAsyncAEErrorConfiguration().clone());
- }
-
- return metaData;
- }
-
- static public RemoteAEDeploymentMetaData createRemoteAEDeploymentMetaData(
- AEDeploymentMetaData metaData) {
- ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory();
- RemoteAEDeploymentMetaData remoteMetaData = (RemoteAEDeploymentMetaData) factory
- .createObject(RemoteAEDeploymentMetaData.class);
- remoteMetaData.setParent(metaData.getParent());
- remoteMetaData.setKey(metaData.getKey());
- remoteMetaData.setCasMultiplierPoolSize(metaData.getCasMultiplierPoolSize());
- try {
- remoteMetaData.setResourceSpecifier(metaData.getResourceSpecifier(), null, false);
- } catch (InvalidXMLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- // Clone OR Create a new AsyncAggregateErrorConfiguration
- AsyncAEErrorConfiguration aggErrorConfig = null;
- AsyncAEErrorConfiguration errorConfig = metaData.getAsyncAEErrorConfiguration();
- if (errorConfig instanceof AsyncAggregateErrorConfiguration_Impl) {
- // Clone
- aggErrorConfig = errorConfig.clone();
- } else {
- // Create a new AsyncAggregateErrorConfiguration
- Trace.err("errorConfig: " + errorConfig.getClass().getName());
- Trace.err("Create a new AsyncAggregateErrorConfiguration");
- aggErrorConfig = new AsyncAggregateErrorConfiguration_Impl();
- aggErrorConfig.setGetMetadataErrors(new GetMetadataErrors_Impl(errorConfig));
- aggErrorConfig.setProcessCasErrors(errorConfig.getProcessCasErrors().clone(aggErrorConfig));
- aggErrorConfig.setCollectionProcessCompleteErrors(errorConfig
- .getCollectionProcessCompleteErrors().clone(aggErrorConfig));
- }
- remoteMetaData.setErrorConfiguration(aggErrorConfig);
- errorConfig.sParentObject((DeploymentMetaData_Impl)remoteMetaData);
-
- return remoteMetaData;
- }
-
-// static public DDObject createDeploymentTree(AEDeploymentDescription dd) {
-// try {
-// ResourceSpecifier root = dd.getAeService().getTopAnalysisEngineDescription();
-// } catch (InvalidXMLException e) {
-// // TODO Auto-generated catch block
-// e.printStackTrace();
-// }
-//
-// return null;
-// }
-
-/* static public DDObject createDeploymentTree(String key, AnalysisEngineDescription root) {
- if (root == null) {
- return null;
- }
-
- if (root.isPrimitive()) {
- return new DDObject(new DDModel(key, root));
- }
-
- DDParent tree = new DDParent(new DDModel(key, root));
- try {
- Map map = root.getDelegateAnalysisEngineSpecifiers();
- for (Object obj : map.entrySet()) {
- Map.Entry entry = (Map.Entry) obj;
- // Trace.err("key: " + entry.getKey() + " ; " + entry.getValue().getClass().getName());
- DDObject node = buildAnalysisEngineTree((String) entry.getKey(), (ResourceSpecifier) entry
- .getValue());
- tree.add(node);
- }
- } catch (InvalidXMLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- return tree;
- }
-
- static public DDObject buildAnalysisEngineTree(String key, ResourceSpecifier root) {
- DDObject rootNode = null;
-
- if (root instanceof AnalysisEngineDescription) {
- AnalysisEngineDescription ae = (AnalysisEngineDescription) root;
- if (!ae.isPrimitive()) {
- rootNode = new DDParent(new DDModel(key, root));
- try {
- Map map = ae.getDelegateAnalysisEngineSpecifiers();
- for (Object obj : map.entrySet()) {
- Map.Entry entry = (Map.Entry) obj;
- // Trace.err("key: " + entry.getKey() + " ; " + entry.getValue().getClass().getName());
- DDObject node = buildAnalysisEngineTree((String) entry.getKey(),
- (ResourceSpecifier) entry.getValue());
- ((DDParent) rootNode).add(node);
- }
- } catch (InvalidXMLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else {
- rootNode = new DDObject(new DDModel(key, root));
- }
- } else {
- Trace.err("root: " + root.getClass().getName());
- }
-
- return rootNode;
- }
-*/
-// static public void dumpDeploymentTree(DDObject root, int level) {
-// for (int i = 0; i < level; ++i) {
-// System.out.print("---- ");
-// }
-// System.out.println(root.getModel().getLabel());
-//
-// // Has chidren ?
-// if (root instanceof DDParent && ((DDParent) root).getChildCount() > 0) {
-// List<DDObject> list = ((DDParent) root).getChildren();
-// for (DDObject ddo : list) {
-// dumpDeploymentTree(ddo, level + 1);
-// }
-// }
-// }
-
- /** ********************************************************************** */
-/*
- static public BaseTNode createAETree(IFile file, String topDescriptor) {
- String dir = FileUtil.getDirectoryFromIFile(file);
- Trace.err("topDescriptor: " + topDescriptor);
- XMLizable xmlizable = null;
- try {
- xmlizable = UimaXmlParsingUtil.parseUimaXmlDescriptor(dir + topDescriptor);
- } catch (InvalidXMLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return null;
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return null;
- }
-
- if (xmlizable instanceof AnalysisEngineDescription) {
- AnalysisEngineDescription ae = (AnalysisEngineDescription) xmlizable;
- String key = ae.getAnalysisEngineMetaData().getName().trim();
- BaseTNode rootNode = buildAETree(key.length() == 0 ? "root" : key, ae);
- return rootNode;
- } else {
- Trace.err("xmlizable: " + xmlizable.getClass().getName());
- }
- return null;
- }
-
- static public BaseTNode buildAETree(String key, ResourceSpecifier root) {
- BaseTNode rootNode = new BaseTNode(key, root);
-
- if (root instanceof AnalysisEngineDescription) {
- AnalysisEngineDescription ae = (AnalysisEngineDescription) root;
- if (!ae.isPrimitive()) {
- try {
- Map map = ae.getDelegateAnalysisEngineSpecifiers();
- for (Object obj : map.entrySet()) {
- Map.Entry entry = (Map.Entry) obj;
- // Trace.err("key: " + entry.getKey() + " ; " + entry.getValue().getClass().getName());
- BaseTNode node = buildAETree((String) entry.getKey(), (ResourceSpecifier) entry
- .getValue());
- rootNode.addChild(node);
- }
- } catch (InvalidXMLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- } else {
- Trace.err("root: " + root.getClass().getName());
- }
-
- return rootNode;
- }
-
- static public void dumpAETree(BaseTNode rootNode, int level) {
- for (int i = 0; i < level; ++i) {
- System.out.print("---- ");
- }
- System.out.println(rootNode.getLabel());
-
- // Has chidren ?
- if (rootNode.getChildrenList() == null) {
- return;
- }
- for (BaseTNode node : (List<BaseTNode>) rootNode.getChildrenList()) {
- dumpAETree(node, level + 1);
- }
- }
-
- static public void dumpUimaAETree(AnalysisEngineDescription root, int level) {
- for (int i = 0; i < level; ++i) {
- System.out.print("---- ");
- }
- System.out.println(root.getAnalysisEngineMetaData().getName());
-
- // Has chidren ?
- if (root.isPrimitive()) {
- return;
- }
-
- // for (AnalysisEngineDescription aed: root.getDelegateAnalysisEngineSpecifiers()) {
- // dumpAETree(node, level+1);
- // }
- }
-*/
- /** ********************************************************************** */
-
- static public boolean isCASMultiplier(AnalysisEngineDescription ae) {
- return isCASMultiplier(ae.getAnalysisEngineMetaData());
- }
-
- static public boolean isCASMultiplier(AnalysisEngineMetaData meta) {
- OperationalProperties op = meta.getOperationalProperties();
- if (op != null) {
- return op.getOutputsNewCASes();
- }
- return false;
- }
-}
+package org.apache.uima.tools.internal.uima.util;
+
+import org.apache.uima.ResourceSpecifierFactory;
+import org.apache.uima.UIMAFramework;
+import org.apache.uima.aae.deployment.AEDeploymentMetaData;
+import org.apache.uima.aae.deployment.AsyncAEErrorConfiguration;
+import org.apache.uima.aae.deployment.RemoteAEDeploymentMetaData;
+import org.apache.uima.aae.deployment.impl.AsyncAggregateErrorConfiguration_Impl;
+import org.apache.uima.aae.deployment.impl.AsyncPrimitiveErrorConfiguration_Impl;
+import org.apache.uima.aae.deployment.impl.DeploymentMetaData_Impl;
+import org.apache.uima.aae.deployment.impl.GetMetadataErrors_Impl;
+import org.apache.uima.analysis_engine.AnalysisEngineDescription;
+import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
+import org.apache.uima.resource.ResourceSpecifier;
+import org.apache.uima.resource.metadata.Import;
+import org.apache.uima.resource.metadata.OperationalProperties;
+import org.apache.uima.tools.debug.util.Trace;
+import org.apache.uima.util.InvalidXMLException;
+
+
+public class AETreeBuilder {
+
+ static public Import createImport(String descriptor, boolean byLocation) {
+ Import imp = (Import) UIMAFramework.getResourceSpecifierFactory().createObject(Import.class);
+ if (byLocation) {
+ imp.setLocation(descriptor);
+ } else {
+ imp.setName(descriptor);
+ }
+
+ return imp;
+ }
+
+ static public AEDeploymentMetaData createAEDeploymentMetaData(
+ RemoteAEDeploymentMetaData remoteMetaData) {
+ ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory();
+ AEDeploymentMetaData metaData = (AEDeploymentMetaData) factory
+ .createObject(AEDeploymentMetaData.class);
+ metaData.setParent(remoteMetaData.getParent());
+ metaData.setKey(remoteMetaData.getKey());
+ try {
+ metaData.setResourceSpecifier(remoteMetaData.getResourceSpecifier(), null, false);
+ } catch (InvalidXMLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ // Need to call AFTER metaData.setResourceSpecifier
+ metaData.setCasMultiplierPoolSize(remoteMetaData.getCasMultiplierPoolSize());
+
+ // Clone OR Create a new AsyncPrimitiveErrorConfiguration
+// ResourceSpecifier rs = remoteMetaData.getResourceSpecifier();
+ boolean isPrimitive = false;
+// if (rs instanceof AnalysisEngineDescription) {
+// isPrimitive = ((AnalysisEngineDescription) rs).isPrimitive();
+// } else {
+// // Exception ???
+// }
+ if (isPrimitive) {
+ // Create a new AsyncPrimitiveErrorConfiguration
+ AsyncAEErrorConfiguration remoteErrorConfig = remoteMetaData.getAsyncAEErrorConfiguration();
+ AsyncAEErrorConfiguration primitiveErrorConfig = new AsyncPrimitiveErrorConfiguration_Impl();
+ primitiveErrorConfig.setProcessCasErrors(remoteErrorConfig.getProcessCasErrors().clone(
+ primitiveErrorConfig));
+ primitiveErrorConfig.setCollectionProcessCompleteErrors(remoteErrorConfig
+ .getCollectionProcessCompleteErrors().clone(primitiveErrorConfig));
+ metaData.setAsyncAEErrorConfiguration(primitiveErrorConfig);
+ } else {
+ // Clone
+ metaData.setAsyncAEErrorConfiguration((AsyncAEErrorConfiguration) remoteMetaData
+ .getAsyncAEErrorConfiguration().clone());
+ }
+
+ return metaData;
+ }
+
+ static public RemoteAEDeploymentMetaData createRemoteAEDeploymentMetaData(
+ AEDeploymentMetaData metaData) {
+ ResourceSpecifierFactory factory = UIMAFramework.getResourceSpecifierFactory();
+ RemoteAEDeploymentMetaData remoteMetaData = (RemoteAEDeploymentMetaData) factory
+ .createObject(RemoteAEDeploymentMetaData.class);
+ remoteMetaData.setParent(metaData.getParent());
+ remoteMetaData.setKey(metaData.getKey());
+ remoteMetaData.setCasMultiplierPoolSize(metaData.getCasMultiplierPoolSize());
+ try {
+ remoteMetaData.setResourceSpecifier(metaData.getResourceSpecifier(), null, false);
+ } catch (InvalidXMLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // Clone OR Create a new AsyncAggregateErrorConfiguration
+ AsyncAEErrorConfiguration aggErrorConfig = null;
+ AsyncAEErrorConfiguration errorConfig = metaData.getAsyncAEErrorConfiguration();
+ if (errorConfig instanceof AsyncAggregateErrorConfiguration_Impl) {
+ // Clone
+ aggErrorConfig = errorConfig.clone();
+ } else {
+ // Create a new AsyncAggregateErrorConfiguration
+ Trace.err("errorConfig: " + errorConfig.getClass().getName());
+ Trace.err("Create a new AsyncAggregateErrorConfiguration");
+ aggErrorConfig = new AsyncAggregateErrorConfiguration_Impl();
+ aggErrorConfig.setGetMetadataErrors(new GetMetadataErrors_Impl(errorConfig));
+ aggErrorConfig.setProcessCasErrors(errorConfig.getProcessCasErrors().clone(aggErrorConfig));
+ aggErrorConfig.setCollectionProcessCompleteErrors(errorConfig
+ .getCollectionProcessCompleteErrors().clone(aggErrorConfig));
+ }
+ remoteMetaData.setErrorConfiguration(aggErrorConfig);
+ errorConfig.sParentObject((DeploymentMetaData_Impl)remoteMetaData);
+
+ return remoteMetaData;
+ }
+
+// static public DDObject createDeploymentTree(AEDeploymentDescription dd) {
+// try {
+// ResourceSpecifier root = dd.getAeService().getTopAnalysisEngineDescription();
+// } catch (InvalidXMLException e) {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+//
+// return null;
+// }
+
+/* static public DDObject createDeploymentTree(String key, AnalysisEngineDescription root) {
+ if (root == null) {
+ return null;
+ }
+
+ if (root.isPrimitive()) {
+ return new DDObject(new DDModel(key, root));
+ }
+
+ DDParent tree = new DDParent(new DDModel(key, root));
+ try {
+ Map map = root.getDelegateAnalysisEngineSpecifiers();
+ for (Object obj : map.entrySet()) {
+ Map.Entry entry = (Map.Entry) obj;
+ // Trace.err("key: " + entry.getKey() + " ; " + entry.getValue().getClass().getName());
+ DDObject node = buildAnalysisEngineTree((String) entry.getKey(), (ResourceSpecifier) entry
+ .getValue());
+ tree.add(node);
+ }
+ } catch (InvalidXMLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return tree;
+ }
+
+ static public DDObject buildAnalysisEngineTree(String key, ResourceSpecifier root) {
+ DDObject rootNode = null;
+
+ if (root instanceof AnalysisEngineDescription) {
+ AnalysisEngineDescription ae = (AnalysisEngineDescription) root;
+ if (!ae.isPrimitive()) {
+ rootNode = new DDParent(new DDModel(key, root));
+ try {
+ Map map = ae.getDelegateAnalysisEngineSpecifiers();
+ for (Object obj : map.entrySet()) {
+ Map.Entry entry = (Map.Entry) obj;
+ // Trace.err("key: " + entry.getKey() + " ; " + entry.getValue().getClass().getName());
+ DDObject node = buildAnalysisEngineTree((String) entry.getKey(),
+ (ResourceSpecifier) entry.getValue());
+ ((DDParent) rootNode).add(node);
+ }
+ } catch (InvalidXMLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ } else {
+ rootNode = new DDObject(new DDModel(key, root));
+ }
+ } else {
+ Trace.err("root: " + root.getClass().getName());
+ }
+
+ return rootNode;
+ }
+*/
+// static public void dumpDeploymentTree(DDObject root, int level) {
+// for (int i = 0; i < level; ++i) {
+// System.out.print("---- ");
+// }
+// System.out.println(root.getModel().getLabel());
+//
+// // Has chidren ?
+// if (root instanceof DDParent && ((DDParent) root).getChildCount() > 0) {
+// List<DDObject> list = ((DDParent) root).getChildren();
+// for (DDObject ddo : list) {
+// dumpDeploymentTree(ddo, level + 1);
+// }
+// }
+// }
+
+ /** ********************************************************************** */
+/*
+ static public BaseTNode createAETree(IFile file, String topDescriptor) {
+ String dir = FileUtil.getDirectoryFromIFile(file);
+ Trace.err("topDescriptor: " + topDescriptor);
+ XMLizable xmlizable = null;
+ try {
+ xmlizable = UimaXmlParsingUtil.parseUimaXmlDescriptor(dir + topDescriptor);
+ } catch (InvalidXMLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return null;
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ return null;
+ }
+
+ if (xmlizable instanceof AnalysisEngineDescription) {
+ AnalysisEngineDescription ae = (AnalysisEngineDescription) xmlizable;
+ String key = ae.getAnalysisEngineMetaData().getName().trim();
+ BaseTNode rootNode = buildAETree(key.length() == 0 ? "root" : key, ae);
+ return rootNode;
+ } else {
+ Trace.err("xmlizable: " + xmlizable.getClass().getName());
+ }
+ return null;
+ }
+
+ static public BaseTNode buildAETree(String key, ResourceSpecifier root) {
+ BaseTNode rootNode = new BaseTNode(key, root);
+
+ if (root instanceof AnalysisEngineDescription) {
+ AnalysisEngineDescription ae = (AnalysisEngineDescription) root;
+ if (!ae.isPrimitive()) {
+ try {
+ Map map = ae.getDelegateAnalysisEngineSpecifiers();
+ for (Object obj : map.entrySet()) {
+ Map.Entry entry = (Map.Entry) obj;
+ // Trace.err("key: " + entry.getKey() + " ; " + entry.getValue().getClass().getName());
+ BaseTNode node = buildAETree((String) entry.getKey(), (ResourceSpecifier) entry
+ .getValue());
+ rootNode.addChild(node);
+ }
+ } catch (InvalidXMLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ } else {
+ Trace.err("root: " + root.getClass().getName());
+ }
+
+ return rootNode;
+ }
+
+ static public void dumpAETree(BaseTNode rootNode, int level) {
+ for (int i = 0; i < level; ++i) {
+ System.out.print("---- ");
+ }
+ System.out.println(rootNode.getLabel());
+
+ // Has chidren ?
+ if (rootNode.getChildrenList() == null) {
+ return;
+ }
+ for (BaseTNode node : (List<BaseTNode>) rootNode.getChildrenList()) {
+ dumpAETree(node, level + 1);
+ }
+ }
+
+ static public void dumpUimaAETree(AnalysisEngineDescription root, int level) {
+ for (int i = 0; i < level; ++i) {
+ System.out.print("---- ");
+ }
+ System.out.println(root.getAnalysisEngineMetaData().getName());
+
+ // Has chidren ?
+ if (root.isPrimitive()) {
+ return;
+ }
+
+ // for (AnalysisEngineDescription aed: root.getDelegateAnalysisEngineSpecifiers()) {
+ // dumpAETree(node, level+1);
+ // }
+ }
+*/
+ /** ********************************************************************** */
+
+ static public boolean isCASMultiplier(AnalysisEngineDescription ae) {
+ return isCASMultiplier(ae.getAnalysisEngineMetaData());
+ }
+
+ static public boolean isCASMultiplier(AnalysisEngineMetaData meta) {
+ OperationalProperties op = meta.getOperationalProperties();
+ if (op != null) {
+ return op.getOutputsNewCASes();
+ }
+ return false;
+ }
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/AETreeBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/FormMessage.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/FormMessage.java?rev=610059&r1=610058&r2=610059&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/FormMessage.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/FormMessage.java Tue Jan 8 08:36:45 2008
@@ -1,27 +1,27 @@
-package org.apache.uima.tools.internal.uima.util;
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.ui.forms.widgets.Form;
-
-public class FormMessage {
- // static final public String DDE_MSG_TOP_DESCRIPTOR_IS_NOT_SET = "topMessageIsNotSet";
-
- /** ********************************************************************** */
-
- static public void setMessage(Form form, String message, int msgType) {
- form.setMessage(message, msgType);
- }
-
- static public void setMessageInfo(Form form, String message) {
- form.setMessage(message, IMessageProvider.INFORMATION);
- }
-
- static public void setMessageWarning(Form form, String message) {
- form.setMessage(message, IMessageProvider.WARNING);
- }
-
- static public void setMessageError(Form form, String message) {
- form.setMessage(message, IMessageProvider.ERROR);
- }
-
-}
+package org.apache.uima.tools.internal.uima.util;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.ui.forms.widgets.Form;
+
+public class FormMessage {
+ // static final public String DDE_MSG_TOP_DESCRIPTOR_IS_NOT_SET = "topMessageIsNotSet";
+
+ /** ********************************************************************** */
+
+ static public void setMessage(Form form, String message, int msgType) {
+ form.setMessage(message, msgType);
+ }
+
+ static public void setMessageInfo(Form form, String message) {
+ form.setMessage(message, IMessageProvider.INFORMATION);
+ }
+
+ static public void setMessageWarning(Form form, String message) {
+ form.setMessage(message, IMessageProvider.WARNING);
+ }
+
+ static public void setMessageError(Form form, String message) {
+ form.setMessage(message, IMessageProvider.ERROR);
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/FormMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/WorkspaceResourceDialog.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/WorkspaceResourceDialog.java?rev=610059&r1=610058&r2=610059&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/WorkspaceResourceDialog.java (original)
+++ incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/WorkspaceResourceDialog.java Tue Jan 8 08:36:45 2008
@@ -1,72 +1,72 @@
-/**
- *
- * Project UIMA Tooling
- *
- *
- * creation date: Jan 8, 2006, 5:47:09 PM
- * source: ElementTreeDialog.java
- */
-package org.apache.uima.tools.internal.uima.util;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceSorter;
-
-
-/**
- *
- *
- */
-public class WorkspaceResourceDialog
-{
-
- public static IResource getWorkspaceResourceElement (Shell shell, IResource root,
- String dialogTitle, String dialogMessage)
- {
- IResource resource = null;
-
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
- new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle(dialogTitle);
- dialog.setMessage(dialogMessage);
- dialog.setInput(root);
- dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
- int buttonId = dialog.open();
- if (buttonId == IDialogConstants.OK_ID) {
- resource = (IResource) dialog.getFirstResult();
- if (!resource.isAccessible()) {
- return null;
- }
-// String arg = resource.getFullPath().toString();
-// String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
- }
- return resource;
- }
-
- public static IResource getWorkspaceResourceElement_REMOVE (Shell shell, IResource root)
- {
- IResource resource = null;
-
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
- new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- dialog.setTitle("Select UIMA descriptor");
- dialog.setMessage("Select UIMA Xml descriptor file");
- dialog.setInput(root);
- dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
- int buttonId = dialog.open();
- if (buttonId == IDialogConstants.OK_ID) {
- resource = (IResource) dialog.getFirstResult();
- if (!resource.isAccessible()) {
- return null;
- }
-// String arg = resource.getFullPath().toString();
-// String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
- }
- return resource;
- }
-
-}
+/**
+ *
+ * Project UIMA Tooling
+ *
+ *
+ * creation date: Jan 8, 2006, 5:47:09 PM
+ * source: ElementTreeDialog.java
+ */
+package org.apache.uima.tools.internal.uima.util;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.eclipse.ui.views.navigator.ResourceSorter;
+
+
+/**
+ *
+ *
+ */
+public class WorkspaceResourceDialog
+{
+
+ public static IResource getWorkspaceResourceElement (Shell shell, IResource root,
+ String dialogTitle, String dialogMessage)
+ {
+ IResource resource = null;
+
+ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
+ new WorkbenchLabelProvider(), new WorkbenchContentProvider());
+ dialog.setTitle(dialogTitle);
+ dialog.setMessage(dialogMessage);
+ dialog.setInput(root);
+ dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
+ int buttonId = dialog.open();
+ if (buttonId == IDialogConstants.OK_ID) {
+ resource = (IResource) dialog.getFirstResult();
+ if (!resource.isAccessible()) {
+ return null;
+ }
+// String arg = resource.getFullPath().toString();
+// String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
+ }
+ return resource;
+ }
+
+ public static IResource getWorkspaceResourceElement_REMOVE (Shell shell, IResource root)
+ {
+ IResource resource = null;
+
+ ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(shell,
+ new WorkbenchLabelProvider(), new WorkbenchContentProvider());
+ dialog.setTitle("Select UIMA descriptor");
+ dialog.setMessage("Select UIMA Xml descriptor file");
+ dialog.setInput(root);
+ dialog.setSorter(new ResourceSorter(ResourceSorter.NAME));
+ int buttonId = dialog.open();
+ if (buttonId == IDialogConstants.OK_ID) {
+ resource = (IResource) dialog.getFirstResult();
+ if (!resource.isAccessible()) {
+ return null;
+ }
+// String arg = resource.getFullPath().toString();
+// String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$
+ }
+ return resource;
+ }
+
+}
Propchange: incubator/uima/sandbox/trunk/uima-ee/uimaj-ep-deployeditor/src/main/java/org/apache/uima/tools/internal/uima/util/WorkspaceResourceDialog.java
------------------------------------------------------------------------------
svn:eol-style = native