Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 185607 Details for
Bug 332961
ODA Driver Improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
changes to oda.ecore.ui
oda_ecore_ui.patch (text/plain), 8.14 KB, created by
Kenn Hussey
on 2010-12-20 21:02:12 EST
(
hide
)
Description:
changes to oda.ecore.ui
Filename:
MIME Type:
Creator:
Kenn Hussey
Created:
2010-12-20 21:02:12 EST
Size:
8.14 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.emf.oda.ecore.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.oda.ecore.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 5 Dec 2010 01:42:01 -0000 1.1 >+++ META-INF/MANIFEST.MF 21 Dec 2010 01:48:26 -0000 >@@ -10,6 +10,7 @@ > Bundle-RequiredExecutionEnvironment: J2SE-1.5 > Require-Bundle: org.eclipse.core.runtime, > org.eclipse.core.resources, >+ org.eclipse.jface.text, > org.eclipse.datatools.connectivity.oda.design.ui, > org.eclipse.emf.edit.ui, > org.eclipse.emf.ecore.edit, >Index: src/org/eclipse/emf/oda/ecore/ui/impl/EcoreDataSetWizardPage.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.emf/org.eclipse.emf/plugins/org.eclipse.emf.oda.ecore.ui/src/org/eclipse/emf/oda/ecore/ui/impl/EcoreDataSetWizardPage.java,v >retrieving revision 1.3 >diff -u -r1.3 EcoreDataSetWizardPage.java >--- src/org/eclipse/emf/oda/ecore/ui/impl/EcoreDataSetWizardPage.java 15 Dec 2010 16:20:04 -0000 1.3 >+++ src/org/eclipse/emf/oda/ecore/ui/impl/EcoreDataSetWizardPage.java 21 Dec 2010 01:48:27 -0000 >@@ -60,6 +60,7 @@ > import org.eclipse.emf.ecore.util.EcoreUtil; > import org.eclipse.emf.ecore.util.QueryDelegate; > import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; >+import org.eclipse.emf.edit.ui.util.QueryDelegateTextViewer; > import org.eclipse.emf.oda.ecore.impl.Connection; > import org.eclipse.emf.oda.ecore.impl.Driver; > import org.eclipse.emf.oda.ecore.impl.ParameterMetaData; >@@ -68,6 +69,11 @@ > import org.eclipse.emf.oda.ecore.util.StringUtil; > import org.eclipse.jface.layout.GridDataFactory; > import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.jface.text.Document; >+import org.eclipse.jface.text.ITextListener; >+import org.eclipse.jface.text.ITextViewer; >+import org.eclipse.jface.text.TextEvent; >+import org.eclipse.jface.text.TextViewer; > import org.eclipse.jface.viewers.ColumnWeightData; > import org.eclipse.jface.viewers.ILabelProviderListener; > import org.eclipse.jface.viewers.ISelection; >@@ -82,6 +88,7 @@ > import org.eclipse.jface.viewers.Viewer; > import org.eclipse.jface.window.Window; > import org.eclipse.swt.SWT; >+import org.eclipse.swt.custom.StackLayout; > import org.eclipse.swt.events.ModifyEvent; > import org.eclipse.swt.events.ModifyListener; > import org.eclipse.swt.events.MouseAdapter; >@@ -112,7 +119,9 @@ > > protected Combo queryDelegateCombo = null; > >- protected Text queryTextField = null; >+ protected Map<String, ITextViewer> queryTextViewers = new HashMap<String, ITextViewer>(); >+ protected Composite queryTextViewerComposite = null; >+ protected StackLayout queryTextViewerStackLayout = null; > > protected TableViewer variablesViewer = null; > protected List<Variable> variables = new UniqueEList<Variable>(); >@@ -175,11 +184,36 @@ > queryDelegateLabel.setText(ODAEcoreUIPlugin.INSTANCE.getString("_UI_QueryDelegate_label")); //$NON-NLS-1$ > > queryDelegateCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY); >- queryDelegateCombo.addSelectionListener(new SelectionAdapter() >+ queryDelegateCombo.addModifyListener(new ModifyListener() > { >- @Override >- public void widgetSelected(SelectionEvent ee) >+ public void modifyText(ModifyEvent me) > { >+ String queryDelegate = getQueryDelegate(); >+ QueryDelegateTextViewer.Factory factory = (QueryDelegateTextViewer.Factory)QueryDelegateTextViewer.Factory.Registry.INSTANCE.get(queryDelegate); >+ >+ ITextViewer queryTextViewer = queryTextViewers.get(queryDelegate); >+ >+ if (queryTextViewer == null) >+ { >+ queryTextViewer = factory != null >+ ? factory.createTextViewer(queryTextViewerComposite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL) : new TextViewer( >+ queryTextViewerComposite, >+ SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); >+ >+ queryTextViewer.addTextListener(new ITextListener() >+ { >+ public void textChanged(TextEvent te) >+ { >+ validateData(); >+ } >+ }); >+ >+ queryTextViewers.put(queryDelegate, queryTextViewer); >+ } >+ >+ queryTextViewerStackLayout.topControl = queryTextViewer.getTextWidget(); >+ queryTextViewerComposite.layout(); >+ > validateData(); > } > }); >@@ -189,11 +223,6 @@ > queryDelegateCombo.add(uri); > } > >- if (queryDelegateCombo.getItemCount() > 0) >- { >- queryDelegateCombo.setText(queryDelegateCombo.getItem(0)); >- } >- > GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(queryDelegateCombo); > } > >@@ -381,6 +410,12 @@ > { > public void inputChanged(Viewer viewer, Object oldInput, Object newInput) > { >+ ITextViewer queryTextViewer = getQueryTextViewer(); >+ >+ if (queryTextViewer instanceof QueryDelegateTextViewer) >+ { >+ ((QueryDelegateTextViewer)queryTextViewer).setParameters(convertVariablesToMap(getVariables())); >+ } > } > > public void dispose() >@@ -528,16 +563,9 @@ > Label queryTextLabel = new Label(parent, SWT.NONE); > queryTextLabel.setText(ODAEcoreUIPlugin.INSTANCE.getString("_UI_QueryText_label")); //$NON-NLS-1$ > >- queryTextField = new Text(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); >- queryTextField.addModifyListener(new ModifyListener() >- { >- public void modifyText(ModifyEvent me) >- { >- validateData(); >- } >- }); >+ (queryTextViewerComposite = new Composite(parent, SWT.NONE)).setLayout(queryTextViewerStackLayout = new StackLayout()); > >- GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(queryTextField); >+ GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(queryTextViewerComposite); > } > > /** >@@ -609,23 +637,31 @@ > return; // nothing to initialize > } > >- String queryText = dataSetDesign.getQueryText(); >- >- if (queryText != null) >- { >- // initialize query text >- queryTextField.setText(queryText); >- } >- > Properties properties = DesignUtil.convertDesignProperties(dataSetDesign.getPublicProperties()); > > String queryDelegate = properties.getProperty(Query.DELEGATE_PROPERTY_NAME); > >- if (queryDelegate != null) >+ if (!StringUtil.isEmpty(queryDelegate)) > { > // initialize query delegate > queryDelegateCombo.setText(queryDelegate); > } >+ else if (queryDelegateCombo.getItemCount() > 0) >+ { >+ queryDelegateCombo.setText(queryDelegateCombo.getItem(0)); >+ } >+ >+ String queryText = dataSetDesign.getQueryText(); >+ >+ if (!StringUtil.isEmpty(queryText)) >+ { >+ // initialize query text >+ getQueryTextViewer().setDocument(new Document(queryText)); >+ } >+ else >+ { >+ getQueryTextViewer().setDocument(new Document()); >+ } > > String context = properties.getProperty(Query.CONTEXT_PROPERTY_NAME); > >@@ -843,7 +879,7 @@ > */ > protected String getQueryDelegate() > { >- return queryDelegateCombo == null ? null : queryDelegateCombo.getText(); >+ return queryDelegateCombo == null || queryDelegateCombo.isDisposed() ? null : queryDelegateCombo.getText(); > } > > /** >@@ -855,13 +891,19 @@ > return variables; > } > >+ protected ITextViewer getQueryTextViewer() >+ { >+ return queryTextViewers.get(getQueryDelegate()); >+ } >+ > /** > * Returns the value of the query text. > * @return the query text > */ > protected String getQueryText() > { >- return queryTextField == null ? null : queryTextField.getText(); >+ ITextViewer queryTextViewer = getQueryTextViewer(); >+ return queryTextViewer == null ? null : queryTextViewer.getDocument().get(); > } > > /** >@@ -885,6 +927,13 @@ > { > contextTypeField.setText(StringUtil.getTypeText(contextType)); > } >+ >+ ITextViewer queryTextViewer = getQueryTextViewer(); >+ >+ if (queryTextViewer instanceof QueryDelegateTextViewer) >+ { >+ ((QueryDelegateTextViewer)queryTextViewer).setContext(contextType); >+ } > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 332961
:
185584
|
185606
| 185607