diff --git a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java b/plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java index 5590fc9671..959a8bcb78 100644 --- a/plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java +++ b/plugins/org.teiid.designer.core/src/org/teiid/designer/core/refactor/ModelCopyCommand.java @@ -43,6 +43,7 @@ import org.teiid.core.designer.id.IDGenerator; import org.teiid.core.designer.plugin.PluginUtilities; import org.teiid.designer.core.ModelerCore; +import org.teiid.designer.core.builder.ModelBuildUtil; import org.teiid.designer.core.resource.EmfResource; import org.teiid.designer.core.types.DatatypeConstants; import org.teiid.designer.core.util.ConcurrentModelVisitorProcessor; @@ -619,7 +620,8 @@ protected void executeXmiCopy( final IProgressMonitor monitor ) { } // Save the resulting target resource - try { + try { + ModelBuildUtil.rebuildImports(target, true); modelResource.save(monitor, true); } catch (Throwable e) { final Object[] params = new Object[] {modelResource}; diff --git a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java index be4a9b1abe..7099121192 100644 --- a/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java +++ b/plugins/org.teiid.designer.relational/src/org/teiid/designer/relational/model/RelationalModelFactory.java @@ -763,7 +763,7 @@ protected void applyTableExtensionProperties(RelationalTable tableRef, BaseTable tableRef.getNativeQuery() ); } catch (Exception ex) { - RelationalPlugin.Util.log(IStatus.ERROR, + RelationalPlugin.Util.log(IStatus.ERROR, ex, NLS.bind(Messages.relationalModelFactory_error_setting_extension_props_on_0, tableRef.getName())); } } @@ -828,7 +828,7 @@ protected void applyProcedureExtensionProperties(RelationalProcedure procedureRe } } } catch (Exception ex) { - RelationalPlugin.Util.log(IStatus.ERROR, + RelationalPlugin.Util.log(IStatus.ERROR, ex, NLS.bind(Messages.relationalModelFactory_error_setting_extension_props_on_0, procedureRef.getName())); } } diff --git a/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF b/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF index 7e87d6ece9..4f9a8a320c 100644 --- a/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF +++ b/plugins/org.teiid.designer.transformation.ui/META-INF/MANIFEST.MF @@ -69,7 +69,8 @@ Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.8.0,4.0.0)", org.teiid.datatools.connectivity.ui;bundle-version="[8.1.0,9.0.0)", org.teiid.designer.datatools.ui;bundle-version="[8.1.0,9.0.0)", org.eclipse.datatools.connectivity.ui;bundle-version="[1.2.3,2.0.0)", - org.teiid.designer.spi;bundle-version="[8.1.0,9.0.0)" + org.teiid.designer.spi;bundle-version="[8.1.0,9.0.0)", + org.eclipse.search;bundle-version="3.8.0" Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Import-Package: org.apache.xerces.parsers diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddTransformationSourceAction.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddTransformationSourceAction.java index 6cdc779835..76cced6099 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddTransformationSourceAction.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddTransformationSourceAction.java @@ -13,6 +13,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.search.ui.ISearchResultViewPart; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPart; import org.teiid.designer.core.ModelerCore; @@ -68,6 +69,10 @@ public class AddTransformationSourceAction extends TransformationAction { // CONSTRUCTORS /////////////////////////////////////////////////////////////////////////////////////////////// + /** + * @param transformationEObject the SQL transformation root (cannot be null) + * @param diagram the diagram where this action is installed (cannot be null) + */ public AddTransformationSourceAction(EObject transformationEObject, Diagram diagram) { super(transformationEObject, diagram); setImageDescriptor(UiPlugin.getDefault().getImageDescriptor(UiConstants.Images.ADD_SOURCES)); @@ -81,28 +86,33 @@ public AddTransformationSourceAction(EObject transformationEObject, Diagram diag * @see org.eclipse.ui.ISelectionListener#selectionChanged(IWorkbenchPart, ISelection) */ @Override - public void selectionChanged(IWorkbenchPart thePart, ISelection theSelection) { - // Save off current selection to old if part is ModelEditor and selection == null - // This indicates a focus change and part activation. - if (thePart != null && thePart instanceof ModelEditor) { - oldSelection = getSelection(); - } - + public void selectionChanged(final IWorkbenchPart thePart, + ISelection theSelection) { ISelection selection = theSelection; - // Now we see if the selection is from Search Results? - List searchResults = SearchPageUtil.getEObjectsFromSearchSelection(theSelection); - if( searchResults != null ) { - if( searchResults.isEmpty() ) { - selection = new StructuredSelection(); + + if (wasToolBarItemSelected()) { + if (!(thePart instanceof ModelEditor)) { + selection = this.focusedSelection; + } + } else { + if (thePart instanceof ISearchResultViewPart) { + final List searchResults = SearchPageUtil.getEObjectsFromSearchSelection(theSelection); + + if (searchResults != null) { + if (searchResults.isEmpty()) { + selection = StructuredSelection.EMPTY; + } else { + selection = new StructuredSelection(searchResults); + } + } + + this.focusedSelection = selection; } else { - selection = new StructuredSelection(searchResults); + this.focusedSelection = theSelection; } } - // initialize abstract base class info + super.selectionChanged(thePart, selection); - - setFocusedSelection(); - setEnabled(shouldEnable()); } @@ -241,7 +251,7 @@ private boolean shouldEnable() { } } } - + return enable; } @@ -278,7 +288,7 @@ private TransformationObjectEditorPage getTransObjectEditorPage() { return transOEP; } - public boolean wasToolBarItemSelected() { + private boolean wasToolBarItemSelected() { if( toolBarManager != null ) { if( toolBarManager.getFocusedToolItem() != null && thisToolItem != null ) { if( thisToolItem.equals(toolBarManager.getFocusedToolItem())) @@ -289,6 +299,9 @@ public boolean wasToolBarItemSelected() { return false; } + /** + * @param aci the contribution item associated with this action (cannot be null) + */ public void setItem(ActionContributionItem aci) { if( toolBarManager != null ) { thisToolItem = aci; @@ -301,27 +314,29 @@ private void setFocusedSelection() { }else { focusedSelection = getSelection(); } + + setEnabled(shouldEnable()); } + /** + * @param tbManager the toolbar where this action is installed (cannot be null) + */ public void setToolBarManager(DiagramToolBarManager tbManager) { toolBarManager = tbManager; } - /** - * Gets a string representation of the properties of the given Notification. - * @param theNotification the notification being processed - * @return the string representation - */ - public String getActionString() { - - return new StringBuffer() - .append("\n Action State ---------------------------------------------- = ") //$NON-NLS-1$ - .append("\n oldSelection = ").append(oldSelection) //$NON-NLS-1$ - .append("\n focusedSelection = ").append(focusedSelection) //$NON-NLS-1$ - .append("\n currentSelection = ").append(getSelection()) //$NON-NLS-1$ - .append("\n enabled = ").append(this.isEnabled()) //$NON-NLS-1$ - .append("\n -----------------------------------------------------------") //$NON-NLS-1$ - .toString(); - } +// private String getActionString() { +// +// return new StringBuffer() +// .append("\n Action State ---------------------------------------------- = ") //$NON-NLS-1$ +// .append("\n oldSelection = ").append(oldSelection) //$NON-NLS-1$ +// .append("\n focusedSelection = ").append(focusedSelection) //$NON-NLS-1$ +// .append("\n currentSelection = ").append(getSelection()) //$NON-NLS-1$ +// .append("\n enabled = ").append(this.isEnabled()) //$NON-NLS-1$ +// .append("\n shouldEnable = ").append(shouldEnable()) //$NON-NLS-1$ +// .append("\n wasToolBarItemSelected = ").append(wasToolBarItemSelected()) //$NON-NLS-1$ +// .append("\n -----------------------------------------------------------") //$NON-NLS-1$ +// .toString(); +// } } diff --git a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddUnionSourceAction.java b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddUnionSourceAction.java index 2a883e3eb3..3f88a02b0a 100644 --- a/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddUnionSourceAction.java +++ b/plugins/org.teiid.designer.transformation.ui/src/org/teiid/designer/transformation/ui/actions/AddUnionSourceAction.java @@ -12,6 +12,8 @@ import org.eclipse.jface.action.ActionContributionItem; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.search.ui.ISearchResultViewPart; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchPart; import org.teiid.designer.core.ModelerCore; @@ -28,6 +30,7 @@ import org.teiid.designer.ui.editors.ModelEditor; import org.teiid.designer.ui.editors.ModelObjectEditorPage; import org.teiid.designer.ui.editors.MultiPageModelEditor; +import org.teiid.designer.ui.search.SearchPageUtil; import org.teiid.designer.ui.undo.ModelerUndoManager; /** @@ -68,6 +71,10 @@ public class AddUnionSourceAction extends TransformationAction { // CONSTRUCTORS /////////////////////////////////////////////////////////////////////////////////////////////// + /** + * @param transformationEObject the SQL transformation root (cannot be null) + * @param diagram the diagram where this action is installed (cannot be null) + */ public AddUnionSourceAction(EObject transformationEObject, Diagram diagram) { super(transformationEObject, diagram); setImageDescriptor(UiPlugin.getDefault().getImageDescriptor(UiConstants.Images.ADD_UNION_SOURCES)); @@ -82,17 +89,31 @@ public AddUnionSourceAction(EObject transformationEObject, Diagram diagram) { */ @Override public void selectionChanged(IWorkbenchPart thePart, ISelection theSelection) { - // Save off current selection to old if part is ModelEditor and selection == null - // This indicates a focus change and part activation. - if (thePart != null && thePart instanceof ModelEditor) { - oldSelection = getSelection(); + ISelection selection = theSelection; + + if (wasToolBarItemSelected()) { + if (!(thePart instanceof ModelEditor)) { + selection = this.focusedSelection; + } + } else { + if (thePart instanceof ISearchResultViewPart) { + final List searchResults = SearchPageUtil.getEObjectsFromSearchSelection(theSelection); + + if (searchResults != null) { + if (searchResults.isEmpty()) { + selection = StructuredSelection.EMPTY; + } else { + selection = new StructuredSelection(searchResults); + } + } + + this.focusedSelection = selection; + } else { + this.focusedSelection = theSelection; + } } - - // initialize abstract base class info - super.selectionChanged(thePart, theSelection); - - setFocusedSelection(); - + + super.selectionChanged(thePart, selection); setEnabled(shouldEnable()); } @@ -282,7 +303,7 @@ private TransformationObjectEditorPage getTransObjectEditorPage() { return transOEP; } - public boolean wasToolBarItemSelected() { + private boolean wasToolBarItemSelected() { if( toolBarManager != null ) { if( toolBarManager.getFocusedToolItem() != null && thisToolItem != null ) { if( thisToolItem.equals(toolBarManager.getFocusedToolItem())) @@ -293,6 +314,9 @@ public boolean wasToolBarItemSelected() { return false; } + /** + * @param aci the contribution item associated with this action (cannot be null) + */ public void setItem(ActionContributionItem aci) { if( toolBarManager != null ) { thisToolItem = aci; @@ -304,27 +328,34 @@ private void setFocusedSelection() { focusedSelection = oldSelection; else focusedSelection = getSelection(); + + setEnabled(shouldEnable()); } + /** + * @param tbManager the toolbar where this action is installed (cannot be null) + */ public void setToolBarManager(DiagramToolBarManager tbManager) { toolBarManager = tbManager; } - + /** * Gets a string representation of the properties of the given Notification. * @param theNotification the notification being processed * @return the string representation */ - public String getActionString() { - - return new StringBuffer() - .append("\n Action State ---------------------------------------------- = ") //$NON-NLS-1$ - .append("\n oldSelection = ").append(oldSelection) //$NON-NLS-1$ - .append("\n focusedSelection = ").append(focusedSelection) //$NON-NLS-1$ - .append("\n currentSelection = ").append(getSelection()) //$NON-NLS-1$ - .append("\n enabled = ").append(this.isEnabled()) //$NON-NLS-1$ - .append("\n -----------------------------------------------------------") //$NON-NLS-1$ - .toString(); - } +// private String getActionString() { +// +// return new StringBuffer() +// .append("\n Action State ---------------------------------------------- = ") //$NON-NLS-1$ +// .append("\n oldSelection = ").append(oldSelection) //$NON-NLS-1$ +// .append("\n focusedSelection = ").append(focusedSelection) //$NON-NLS-1$ +// .append("\n currentSelection = ").append(getSelection()) //$NON-NLS-1$ +// .append("\n enabled = ").append(this.isEnabled()) //$NON-NLS-1$ +// .append("\n shouldEnable = ").append(shouldEnable()) //$NON-NLS-1$ +// .append("\n wasToolBarItemSelected = ").append(wasToolBarItemSelected()) //$NON-NLS-1$ +// .append("\n -----------------------------------------------------------") //$NON-NLS-1$ +// .toString(); +// } } diff --git a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java index 82dc889d50..3b7751e7dd 100644 --- a/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java +++ b/plugins/org.teiid.designer.transformation/src/org/teiid/designer/transformation/model/RelationalViewModelFactory.java @@ -139,7 +139,7 @@ public EObject buildObject( RelationalReference obj, // Create the Table EObject baseTable = createBaseTable(obj, modelResource); modelResource.getEmfResource().getContents().add(baseTable); - applyTableExtensionProperties((RelationalTable)obj, (BaseTable)baseTable, false); + applyTableExtensionProperties((RelationalTable)obj, (BaseTable)baseTable, true); // Set the transformation SQL RelationalViewTable viewTable = (RelationalViewTable)obj; diff --git a/plugins/teiid/org.teiid.7.7.x b/plugins/teiid/org.teiid.7.7.x index 98db9bd1be..1410614992 160000 --- a/plugins/teiid/org.teiid.7.7.x +++ b/plugins/teiid/org.teiid.7.7.x @@ -1 +1 @@ -Subproject commit 98db9bd1bef2db7ebd58076f9f99131c58c13dc0 +Subproject commit 14106149920253e31208b40cc6a4c95a84fc79aa diff --git a/plugins/teiid/org.teiid.8.2.x b/plugins/teiid/org.teiid.8.2.x index 24a8d16a2f..26e46e3c13 160000 --- a/plugins/teiid/org.teiid.8.2.x +++ b/plugins/teiid/org.teiid.8.2.x @@ -1 +1 @@ -Subproject commit 24a8d16a2f6368f034a463f4841c879141ac0876 +Subproject commit 26e46e3c13930b6143292ba6f51fb38d805c786e