Author: DartPeng
Date: 2008-08-16 04:37:20 -0400 (Sat, 16 Aug 2008)
New Revision: 9752
Added:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/AbstractFileSelectionWizardPage.java
Removed:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XSDStructuredDataWizardPage.java
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
Log:
Copied:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/AbstractFileSelectionWizardPage.java
(from rev 9751,
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XSDStructuredDataWizardPage.java)
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/AbstractFileSelectionWizardPage.java
(rev 0)
+++
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/AbstractFileSelectionWizardPage.java 2008-08-16
08:37:20 UTC (rev 9752)
@@ -0,0 +1,317 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.xml.ui;
+
+import java.util.Collections;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.util.XSDResourceFactoryImpl;
+import org.jboss.tools.smooks.xml.model.XMLStructuredModelContentProvider;
+import org.jboss.tools.smooks.xml.model.XMLStructuredModelLabelProvider;
+
+/**
+ *
+ * @author Dart Peng Date : 2008-8-13
+ */
+public class AbstractFileSelectionWizardPage extends WizardPage implements
+ SelectionListener {
+
+ protected Object returnObject = null;
+ protected Text fileText;
+ protected Composite fileTextComposite;
+ protected CheckboxTableViewer tableViewer = null;
+ protected Button fileSystemBrowseButton;
+ protected boolean reasourceLoaded = false;
+ private Button workspaceBrowseButton;
+
+ public AbstractFileSelectionWizardPage(String pageName, String title,
+ ImageDescriptor titleImage) {
+ super(pageName, title, titleImage);
+ // TODO Auto-generated constructor stub
+ }
+
+ public AbstractFileSelectionWizardPage(String pageName) {
+ super(pageName);
+ // TODO Auto-generated constructor stub
+ }
+
+ public Object getReturnValue() {
+ return returnObject;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createControl(Composite parent) {
+
+ Composite mainComposite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ mainComposite.setLayout(layout);
+
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.grabExcessHorizontalSpace = true;
+ gd.grabExcessVerticalSpace = true;
+ mainComposite.setLayoutData(gd);
+
+ // xmlButton = new Button(mainComposite, SWT.RADIO);
+ // xmlButton.setText("Select a XML file");
+ //
+ // Composite xmlComposite = this
+ // .createXMLFileSelectionComposite(mainComposite);
+ //
+ // Label sp = new Label(mainComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
+ // gd = new GridData(GridData.FILL_HORIZONTAL);
+ // sp.setLayoutData(gd);
+ //
+ // xsdButton = new Button(mainComposite, SWT.RADIO);
+ // xsdButton.setText("Select a XSD file");
+
+ Composite xsdComposite = this
+ .createFileSelectionComposite(mainComposite);
+
+ // init the panel status (XSD file selection composite is disabled)
+ // xsdButton.setSelection(true);
+ //
+ // setCompositeChildrenEnabled(xmlComposite, false);
+
+ // registe the listener for controls
+ hookBrowseButtonSelectionAdapter();
+ hookFileTextModifyListener();
+ hookRadioButtonSelectionAdapter();
+ this.setControl(mainComposite);
+ }
+
+ protected void hookFileTextModifyListener() {
+ final ModifyListener modifyListener = new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ changeWizardPageStatus();
+ }
+ };
+ // xmlFileText.addModifyListener(modifyListener);
+ fileText.addModifyListener(modifyListener);
+ }
+
+ protected void hookRadioButtonSelectionAdapter() {
+ // xsdButton.addSelectionListener(this);
+ }
+
+ protected void hookBrowseButtonSelectionAdapter() {
+ SelectionAdapter browseButtonSelectionAdapter = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Text relationT = null;
+ // if (e.getSource() == xmlFileSystemBrowseButton) {
+ // relationT = xmlFileText;
+ // }
+ if (e.getSource() == fileSystemBrowseButton) {
+ relationT = fileText;
+ }
+ openFileSelection(relationT);
+ }
+ };
+ // xmlFileSystemBrowseButton
+ // .addSelectionListener(browseButtonSelectionAdapter);
+ fileSystemBrowseButton
+ .addSelectionListener(browseButtonSelectionAdapter);
+ }
+
+ protected Composite createFileSelectionComposite(Composite parent) {
+ Composite xsdComposite = new Composite(parent, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ xsdComposite.setLayoutData(gd);
+ GridLayout xsdLayout = new GridLayout();
+ xsdLayout.numColumns = 2;
+ xsdLayout.marginWidth = 0;
+ xsdComposite.setLayout(xsdLayout);
+
+ Composite browseButtonComposite = new Composite(xsdComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ browseButtonComposite.setLayoutData(gd);
+
+ GridLayout bg = new GridLayout();
+ bg.numColumns = 2;
+ bg.marginHeight = 0;
+ bg.marginWidth = 0;
+ bg.makeColumnsEqualWidth = false;
+ browseButtonComposite.setLayout(bg);
+
+ fileSystemBrowseButton = new Button(browseButtonComposite, SWT.NONE);
+ fileSystemBrowseButton.setText("Browse File System...");
+
+ workspaceBrowseButton = new Button(
+ browseButtonComposite, SWT.NONE);
+ workspaceBrowseButton.setText("Browse workspace file..");
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalAlignment = GridData.END;
+ gd.grabExcessHorizontalSpace = true;
+ workspaceBrowseButton.setLayoutData(gd);
+
+ gd = new GridData();
+ gd.grabExcessHorizontalSpace = true;
+ fileSystemBrowseButton.setLayoutData(gd);
+
+ Label nfileLanel = new Label(xsdComposite, SWT.NONE);
+ nfileLanel.setText("XSD File Path :");
+ fileTextComposite = new Composite(xsdComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.grabExcessHorizontalSpace = true;
+ fileTextComposite.setLayoutData(gd);
+ GridLayout xsdtgl = new GridLayout();
+ xsdtgl.marginWidth = 0;
+ xsdtgl.marginHeight = 0;
+ xsdtgl.numColumns = 1;
+ fileTextComposite.setLayout(xsdtgl);
+
+ fileText = new Text(fileTextComposite, SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ fileText.setLayoutData(gd);
+ gd.grabExcessHorizontalSpace = true;
+
+ final Button loadXSDButton = new Button(fileTextComposite, SWT.NONE);
+ loadXSDButton.setText("Load");
+ loadXSDButton.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+ reasourceLoaded = false;
+ try {
+ returnObject = loadedTheObject(fileText.getText());
+ reasourceLoaded = true;
+ } catch (Throwable e2) {
+ // ignore
+ e2.printStackTrace();
+ }
+ changeWizardPageStatus();
+ }
+
+ });
+
+ // tableViewer = CheckboxTableViewer.newCheckList(xsdComposite,
+ // SWT.FULL_SELECTION | SWT.BORDER);
+ // gd = new GridData(GridData.FILL_BOTH);
+ // gd.heightHint = 200;
+ // gd.horizontalSpan = 2;
+ // tableViewer.getControl().setLayoutData(gd);
+ //
+ // initTableViewer();
+
+ return xsdComposite;
+ }
+
+ protected Object loadedTheObject(String path) throws Exception {
+ Resource resource = new XSDResourceFactoryImpl().createResource(URI
+ .createFileURI(path));
+ resource.load(Collections.EMPTY_MAP);
+ XSDSchema schema = (XSDSchema) resource.getContents().get(0);
+ return schema;
+ }
+
+ protected void initTableViewer() {
+ tableViewer.addCheckStateListener(new ICheckStateListener() {
+ boolean flag = true;
+
+ @Override
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (flag) {
+ Object checkObject = event.getElement();
+ boolean check = event.getChecked();
+ flag = false;
+ tableViewer.setAllChecked(false);
+ tableViewer.setChecked(checkObject, check);
+ flag = true;
+ changeWizardPageStatus();
+ }
+ }
+ });
+ tableViewer.setContentProvider(new XMLStructuredModelContentProvider());
+ tableViewer.setLabelProvider(new XMLStructuredModelLabelProvider());
+ }
+
+ protected void setCompositeChildrenEnabled(Composite composite,
+ boolean enabled) {
+ Control[] children = composite.getChildren();
+ for (int i = 0; i < children.length; i++) {
+ Control child = children[i];
+ if (child instanceof Text) {
+ child.setEnabled(enabled);
+ }
+ if (child instanceof Button) {
+ child.setEnabled(enabled);
+ }
+ if (child instanceof Composite) {
+ setCompositeChildrenEnabled((Composite) child, enabled);
+ }
+ }
+ }
+
+ protected void openFileSelection(Text relationText) {
+ FileDialog dialog = new FileDialog(this.getShell());
+ String path = dialog.open();
+ if (path != null) {
+ relationText.setText(path);
+ } else {
+ relationText.setText("");
+ }
+ }
+
+ protected void changeWizardPageStatus() {
+ String text = this.fileText.getText();
+ String error = null;
+ if (text == null || "".equals(text))
+ error = "Please Select a file";
+ if (!reasourceLoaded) {
+ error = "Resource must be loaded";
+ }
+ this.setErrorMessage(error);
+ this.setPageComplete(error == null);
+
+ }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ changeWizardPageStatus();
+ }
+
+ public CheckboxTableViewer getTableViewer() {
+ return tableViewer;
+ }
+
+ public void setTableViewer(CheckboxTableViewer tableViewer) {
+ this.tableViewer = tableViewer;
+ }
+
+}
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-08-16
08:36:34 UTC (rev 9751)
+++
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-08-16
08:37:20 UTC (rev 9752)
@@ -18,7 +18,7 @@
*/
public class XMLStructuredDataWizard extends Wizard implements
IStrucutredDataCreationWizard {
- XSDStructuredDataWizardPage page = null;
+ AbstractFileSelectionWizardPage page = null;
Object xsdElement = null;
/**
*
@@ -30,7 +30,7 @@
@Override
public void addPages() {
if(page == null){
- page = new XSDStructuredDataWizardPage("XML");
+ page = new AbstractFileSelectionWizardPage("XML");
}
this.addPage(page);
}
Deleted:
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XSDStructuredDataWizardPage.java
===================================================================
---
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XSDStructuredDataWizardPage.java 2008-08-16
08:36:34 UTC (rev 9751)
+++
workspace/dart/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XSDStructuredDataWizardPage.java 2008-08-16
08:37:20 UTC (rev 9752)
@@ -1,317 +0,0 @@
-/**
- *
- */
-package org.jboss.tools.smooks.xml.ui;
-
-import java.util.Collections;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.xsd.XSDSchema;
-import org.eclipse.xsd.util.XSDResourceFactoryImpl;
-import org.jboss.tools.smooks.xml.model.XMLStructuredModelContentProvider;
-import org.jboss.tools.smooks.xml.model.XMLStructuredModelLabelProvider;
-
-/**
- *
- * @author Dart Peng Date : 2008-8-13
- */
-public class XSDStructuredDataWizardPage extends WizardPage implements
- SelectionListener {
-
- protected Object returnObject = null;
- protected Text fileText;
- protected Composite fileTextComposite;
- protected CheckboxTableViewer tableViewer = null;
- protected Button fileSystemBrowseButton;
- protected boolean reasourceLoaded = false;
- private Button workspaceBrowseButton;
-
- public XSDStructuredDataWizardPage(String pageName, String title,
- ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
- // TODO Auto-generated constructor stub
- }
-
- public XSDStructuredDataWizardPage(String pageName) {
- super(pageName);
- // TODO Auto-generated constructor stub
- }
-
- public Object getReturnValue() {
- return returnObject;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public void createControl(Composite parent) {
-
- Composite mainComposite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- mainComposite.setLayout(layout);
-
- GridData gd = new GridData(GridData.FILL_BOTH);
- gd.grabExcessHorizontalSpace = true;
- gd.grabExcessVerticalSpace = true;
- mainComposite.setLayoutData(gd);
-
- // xmlButton = new Button(mainComposite, SWT.RADIO);
- // xmlButton.setText("Select a XML file");
- //
- // Composite xmlComposite = this
- // .createXMLFileSelectionComposite(mainComposite);
- //
- // Label sp = new Label(mainComposite, SWT.HORIZONTAL | SWT.SEPARATOR);
- // gd = new GridData(GridData.FILL_HORIZONTAL);
- // sp.setLayoutData(gd);
- //
- // xsdButton = new Button(mainComposite, SWT.RADIO);
- // xsdButton.setText("Select a XSD file");
-
- Composite xsdComposite = this
- .createFileSelectionComposite(mainComposite);
-
- // init the panel status (XSD file selection composite is disabled)
- // xsdButton.setSelection(true);
- //
- // setCompositeChildrenEnabled(xmlComposite, false);
-
- // registe the listener for controls
- hookBrowseButtonSelectionAdapter();
- hookFileTextModifyListener();
- hookRadioButtonSelectionAdapter();
- this.setControl(mainComposite);
- }
-
- protected void hookFileTextModifyListener() {
- final ModifyListener modifyListener = new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- changeWizardPageStatus();
- }
- };
- // xmlFileText.addModifyListener(modifyListener);
- fileText.addModifyListener(modifyListener);
- }
-
- protected void hookRadioButtonSelectionAdapter() {
- // xsdButton.addSelectionListener(this);
- }
-
- protected void hookBrowseButtonSelectionAdapter() {
- SelectionAdapter browseButtonSelectionAdapter = new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Text relationT = null;
- // if (e.getSource() == xmlFileSystemBrowseButton) {
- // relationT = xmlFileText;
- // }
- if (e.getSource() == fileSystemBrowseButton) {
- relationT = fileText;
- }
- openFileSelection(relationT);
- }
- };
- // xmlFileSystemBrowseButton
- // .addSelectionListener(browseButtonSelectionAdapter);
- fileSystemBrowseButton
- .addSelectionListener(browseButtonSelectionAdapter);
- }
-
- protected Composite createFileSelectionComposite(Composite parent) {
- Composite xsdComposite = new Composite(parent, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- xsdComposite.setLayoutData(gd);
- GridLayout xsdLayout = new GridLayout();
- xsdLayout.numColumns = 2;
- xsdLayout.marginWidth = 0;
- xsdComposite.setLayout(xsdLayout);
-
- Composite browseButtonComposite = new Composite(xsdComposite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = 2;
- browseButtonComposite.setLayoutData(gd);
-
- GridLayout bg = new GridLayout();
- bg.numColumns = 2;
- bg.marginHeight = 0;
- bg.marginWidth = 0;
- bg.makeColumnsEqualWidth = false;
- browseButtonComposite.setLayout(bg);
-
- fileSystemBrowseButton = new Button(browseButtonComposite, SWT.NONE);
- fileSystemBrowseButton.setText("Browse File System...");
-
- workspaceBrowseButton = new Button(
- browseButtonComposite, SWT.NONE);
- workspaceBrowseButton.setText("Browse workspace file..");
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalAlignment = GridData.END;
- gd.grabExcessHorizontalSpace = true;
- workspaceBrowseButton.setLayoutData(gd);
-
- gd = new GridData();
- gd.grabExcessHorizontalSpace = true;
- fileSystemBrowseButton.setLayoutData(gd);
-
- Label nfileLanel = new Label(xsdComposite, SWT.NONE);
- nfileLanel.setText("XSD File Path :");
- fileTextComposite = new Composite(xsdComposite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- fileTextComposite.setLayoutData(gd);
- GridLayout xsdtgl = new GridLayout();
- xsdtgl.marginWidth = 0;
- xsdtgl.marginHeight = 0;
- xsdtgl.numColumns = 1;
- fileTextComposite.setLayout(xsdtgl);
-
- fileText = new Text(fileTextComposite, SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- fileText.setLayoutData(gd);
- gd.grabExcessHorizontalSpace = true;
-
- final Button loadXSDButton = new Button(fileTextComposite, SWT.NONE);
- loadXSDButton.setText("Load");
- loadXSDButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- reasourceLoaded = false;
- try {
- returnObject = loadedTheObject(fileText.getText());
- reasourceLoaded = true;
- } catch (Throwable e2) {
- // ignore
- e2.printStackTrace();
- }
- changeWizardPageStatus();
- }
-
- });
-
- // tableViewer = CheckboxTableViewer.newCheckList(xsdComposite,
- // SWT.FULL_SELECTION | SWT.BORDER);
- // gd = new GridData(GridData.FILL_BOTH);
- // gd.heightHint = 200;
- // gd.horizontalSpan = 2;
- // tableViewer.getControl().setLayoutData(gd);
- //
- // initTableViewer();
-
- return xsdComposite;
- }
-
- protected Object loadedTheObject(String path) throws Exception {
- Resource resource = new XSDResourceFactoryImpl().createResource(URI
- .createFileURI(path));
- resource.load(Collections.EMPTY_MAP);
- XSDSchema schema = (XSDSchema) resource.getContents().get(0);
- return schema;
- }
-
- protected void initTableViewer() {
- tableViewer.addCheckStateListener(new ICheckStateListener() {
- boolean flag = true;
-
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- if (flag) {
- Object checkObject = event.getElement();
- boolean check = event.getChecked();
- flag = false;
- tableViewer.setAllChecked(false);
- tableViewer.setChecked(checkObject, check);
- flag = true;
- changeWizardPageStatus();
- }
- }
- });
- tableViewer.setContentProvider(new XMLStructuredModelContentProvider());
- tableViewer.setLabelProvider(new XMLStructuredModelLabelProvider());
- }
-
- protected void setCompositeChildrenEnabled(Composite composite,
- boolean enabled) {
- Control[] children = composite.getChildren();
- for (int i = 0; i < children.length; i++) {
- Control child = children[i];
- if (child instanceof Text) {
- child.setEnabled(enabled);
- }
- if (child instanceof Button) {
- child.setEnabled(enabled);
- }
- if (child instanceof Composite) {
- setCompositeChildrenEnabled((Composite) child, enabled);
- }
- }
- }
-
- protected void openFileSelection(Text relationText) {
- FileDialog dialog = new FileDialog(this.getShell());
- String path = dialog.open();
- if (path != null) {
- relationText.setText(path);
- } else {
- relationText.setText("");
- }
- }
-
- protected void changeWizardPageStatus() {
- String text = this.fileText.getText();
- String error = null;
- if (text == null || "".equals(text))
- error = "Please Select a file";
- if (!reasourceLoaded) {
- error = "Resource must be loaded";
- }
- this.setErrorMessage(error);
- this.setPageComplete(error == null);
-
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- changeWizardPageStatus();
- }
-
- public CheckboxTableViewer getTableViewer() {
- return tableViewer;
- }
-
- public void setTableViewer(CheckboxTableViewer tableViewer) {
- this.tableViewer = tableViewer;
- }
-
-}