Skip to content

Commit

Permalink
Merge pull request #415 from phantomjinx/8.6.x
Browse files Browse the repository at this point in the history
8.6.x
  • Loading branch information
blafond committed Oct 13, 2014
2 parents a42a3c7 + 345f085 commit d9df0c8
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 216 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.action.ActionContributionItem;
Expand All @@ -27,7 +26,6 @@
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.teiid.core.designer.util.I18nUtil;
import org.teiid.designer.diagram.ui.DiagramUiConstants;
Expand All @@ -47,11 +45,9 @@
import org.teiid.designer.ui.actions.ModelerActionBarIdManager;
import org.teiid.designer.ui.common.actions.AbstractAction;
import org.teiid.designer.ui.common.actions.ActionService;
import org.teiid.designer.ui.common.actions.ControlledPopupMenuExtender;
import org.teiid.designer.ui.common.actions.GlobalActionsMap;
import org.teiid.designer.ui.editors.AbstractModelEditorPageActionBarContributor;
import org.teiid.designer.ui.editors.ModelEditorPage;
import org.teiid.designer.ui.editors.ModelEditorSite;


/**
Expand Down Expand Up @@ -87,8 +83,6 @@ public final class DiagramActionContributor extends AbstractModelEditorPageActio

private boolean firstTime = true;

private ControlledPopupMenuExtender popupMenuExtender = null;

private boolean contributed = false;

private IMenuManager editMenu;
Expand Down Expand Up @@ -389,12 +383,6 @@ public void menuAboutToShow( IMenuManager theMenuMgr ) {
if (theMenuMgr.find(IModelerActionConstants.ContextMenu.ADDITIONS) == null) {
theMenuMgr.add(new Separator(IModelerActionConstants.ContextMenu.ADDITIONS));
}
if (popupMenuExtender == null) {
// Need to create a PopupMenuExtender to include any external actions here
IEditorPart editor = ((ModelEditorSite)getEditorPage().getEditorSite()).getEditor();
popupMenuExtender = new ControlledPopupMenuExtender(CONTEXT_MENU_ID, (MenuManager)theMenuMgr, selProvider, editor);
}
popupMenuExtender.menuAboutToShow(theMenuMgr);
}
}

Expand Down Expand Up @@ -558,10 +546,6 @@ public void contributeToToolBar( final IToolBarManager toolBarManager ) {
*/
@Override
public void dispose() {
if (this.popupMenuExtender != null) {
this.popupMenuExtender.dispose();
}

for (Iterator<AbstractAction> iter = allRegisteredActions.keySet().iterator(); iter.hasNext();) {
AbstractAction theAction = iter.next();
unregisterAction(theAction);
Expand All @@ -588,14 +572,15 @@ public void dispose() {
public List<IAction> getAdditionalModelingActions( ISelection theSelection ) {
MenuManager menu = new MenuManager("TempMenu", "TempMenuID"); //$NON-NLS-1$ //$NON-NLS-2$

List theActions = new ArrayList();
List<IAction> theActions = new ArrayList<IAction>();

contributeExportedActions(menu);

Object[] theItems = menu.getItems();
IContributionItem[] theItems = menu.getItems();
if (theItems != null && theItems.length > 0) {
for (int i = 0; i < theItems.length; i++) {
theActions.add(theItems[i]);
if (theItems[i] instanceof IAction)
theActions.add((IAction) theItems[i]);
}
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/org.teiid.designer.dqp.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Require-Bundle: org.eclipse.ui.views;bundle-version="[3.6.100,4.0.0)",
org.eclipse.wst.server.core;bundle-version="[1.4.0,2.0.0)",
org.eclipse.wst.server.ui;bundle-version="[1.4.0,2.0.0)",
org.eclipse.ui.navigator;bundle-version="[3.5.200,4.0.0)",
org.jboss.ide.eclipse.as.ui;bundle-version="[3.0.0,4.0.0)",
org.jboss.ide.eclipse.as.core;bundle-version="[3.0.0,4.0.0)",
org.jboss.ide.eclipse.as.ui;bundle-version="[2.4.0,4.0.0)",
org.jboss.ide.eclipse.as.core;bundle-version="[2.4.0,4.0.0)",
org.teiid.designer.spi;bundle-version="[8.1.0,9.0.0)",
org.teiid.designer.webservice.lib;bundle-version="[8.5.0,9.0.0)"
Bundle-ActivationPolicy: lazy
Expand Down
6 changes: 3 additions & 3 deletions plugins/org.teiid.designer.dqp/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.8.0,4.0.0)",
org.teiid.designer.metamodels.function;bundle-version="[8.1.0,9.0.0)",
org.teiid.designer.extension;bundle-version="[8.1.0,9.0.0)",
org.eclipse.wst.server.core;bundle-version="[1.4.0,2.0.0)",
org.jboss.ide.eclipse.as.core;bundle-version="[3.0.0,4.0.0)",
org.jboss.ide.eclipse.as.dmr;bundle-version="[3.0.0,4.0.0)",
org.jboss.ide.eclipse.as.management.core;bundle-version="[3.0.0,4.0.0)",
org.jboss.ide.eclipse.as.core;bundle-version="[2.4.0,4.0.0)",
org.jboss.ide.eclipse.as.dmr;bundle-version="[2.4.0,4.0.0)",
org.jboss.ide.eclipse.as.management.core;bundle-version="[2.4.0,4.0.0)",
org.teiid.designer.relational;bundle-version="[8.1.0,9.0.0)",
org.teiid.datatools.connectivity;bundle-version="[8.1.0,9.0.0)",
org.teiid.designer.spi;bundle-version="[8.1.0,9.0.0)"
Expand Down
6 changes: 0 additions & 6 deletions plugins/org.teiid.designer.json.lib/.project
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
Expand Down
2 changes: 1 addition & 1 deletion plugins/org.teiid.designer.json.lib/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<import file="${GIT-HOME}/scripts/build-common.xml" />

<!-- Comma-separated list of required libraries -->
<property name="libs" value="org.json.jar"/>
<property name="libs" value="json.jar"/>

<!--
Test whether all the required libraries are present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
Expand All @@ -31,9 +30,7 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.teiid.designer.core.ModelerCore;
import org.teiid.designer.core.transaction.SourcedNotification;
import org.teiid.designer.diagram.ui.actions.DiagramGlobalActionsMap;
Expand Down Expand Up @@ -72,15 +69,13 @@
import org.teiid.designer.ui.actions.CopyNameAction;
import org.teiid.designer.ui.actions.IModelObjectActionContributor;
import org.teiid.designer.ui.actions.IModelerActionConstants;
import org.teiid.designer.ui.actions.IModelerActionConstants.ModelerGlobalActions;
import org.teiid.designer.ui.actions.ModelerActionBarIdManager;
import org.teiid.designer.ui.actions.ModelerGlobalActionsMap;
import org.teiid.designer.ui.actions.IModelerActionConstants.ModelerGlobalActions;
import org.teiid.designer.ui.common.actions.AbstractAction;
import org.teiid.designer.ui.common.actions.ControlledPopupMenuExtender;
import org.teiid.designer.ui.common.actions.GlobalActionsMap;
import org.teiid.designer.ui.common.actions.IActionConstants.EclipseGlobalActions;
import org.teiid.designer.ui.editors.ModelEditorPage;
import org.teiid.designer.ui.editors.ModelEditorSite;
import org.teiid.designer.ui.viewsupport.ModelIdentifier;
import org.teiid.designer.ui.viewsupport.ModelUtilities;

Expand All @@ -98,7 +93,7 @@ public class MappingDiagramActionAdapter extends DiagramActionAdapter implements
static final String PARAM_BASE_NAME = UiConstants.Util.getString("MappingDiagramActionAdapter.inputParamBaseName.text"); //$NON-NLS-1$
static final String NEW_INPUT_PARAMETER_TITLE = UiConstants.Util.getString("MappingDiagramActionAdapter.inputParameterTitle.text"); //$NON-NLS-1$

private List modelObjectContributors;
private List<Object> modelObjectContributors;

private AbstractAction showDetailedMappingAction;
private MappingAction newMappingClassAction;
Expand Down Expand Up @@ -167,23 +162,9 @@ private void addDiagramActions( final IMenuManager theMenuMgr ) {
}
}

private void addExtendedActions( final IMenuManager theMenuMgr ) {
final ISelectionProvider selProvider = getEditorPage().getModelObjectSelectionProvider();
if (selProvider != null) {
// Need to create a PopupMenuExtender to include any external actions here
final IEditorPart editor = ((ModelEditorSite)getEditorPage().getEditorSite()).getEditor();
final ControlledPopupMenuExtender popupMenuExtender = new ControlledPopupMenuExtender(
ContextMenu.DIAGRAM_EDITOR_PAGE,
(MenuManager)theMenuMgr,
selProvider, editor);
popupMenuExtender.menuAboutToShow(theMenuMgr);
}

}

private void addExternalExportedActions( final IMenuManager theMenuMgr,
final ISelection selection ) {
final List contributors = getModelObjectActionContributors();
final List<Object> contributors = getModelObjectActionContributors();

for (int size = contributors.size(), i = 0; i < size; i++) {
final IModelObjectActionContributor contributor = (IModelObjectActionContributor)contributors.get(i);
Expand Down Expand Up @@ -367,7 +348,6 @@ private void contributeDetailedActions( final IMenuManager theMenuMgr,
theMenuMgr.add(copyMenu);
theMenuMgr.add(new Separator());
}
addExtendedActions(theMenuMgr);
}
break;
case MappingSelectionHelper.TYPE_STAGING_TABLE:
Expand All @@ -388,7 +368,6 @@ private void contributeDetailedActions( final IMenuManager theMenuMgr,
theMenuMgr.add(copyMenu);
theMenuMgr.add(new Separator());
}
addExtendedActions(theMenuMgr);
}
break;

Expand Down Expand Up @@ -707,7 +686,7 @@ public GlobalActionsMap getGlobalActions() {
*
* @return the list of <code>IModelObjectActionContributor</code> implementations
*/
private List getModelObjectActionContributors() {
private List<Object> getModelObjectActionContributors() {
if (modelObjectContributors == null) {
final String ID = org.teiid.designer.ui.UiConstants.ExtensionPoints.ModelObjectActionContributor.ID;
final String CLASSNAME = org.teiid.designer.ui.UiConstants.ExtensionPoints.ModelObjectActionContributor.CLASSNAME;
Expand All @@ -719,7 +698,7 @@ private List getModelObjectActionContributors() {
final IExtension[] extensions = extensionPoint.getExtensions();

if (extensions.length > 0) {
modelObjectContributors = new ArrayList(extensions.length);
modelObjectContributors = new ArrayList<Object>(extensions.length);

// for each extension get their contributor
for (final IExtension extension2 : extensions) {
Expand All @@ -741,7 +720,7 @@ private List getModelObjectActionContributors() {
new Object[] {element.getAttribute(CLASSNAME)}));
}
}
} else modelObjectContributors = Collections.EMPTY_LIST;
} else modelObjectContributors = Collections.emptyList();
}

return modelObjectContributors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
Expand All @@ -26,8 +25,6 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.teiid.designer.diagram.ui.actions.DiagramGlobalActionsMap;
import org.teiid.designer.diagram.ui.actions.RefreshAction;
Expand All @@ -47,15 +44,13 @@
import org.teiid.designer.ui.actions.EditAction;
import org.teiid.designer.ui.actions.IModelObjectActionContributor;
import org.teiid.designer.ui.actions.IModelerActionConstants;
import org.teiid.designer.ui.actions.IModelerActionConstants.ModelerGlobalActions;
import org.teiid.designer.ui.actions.ModelerActionBarIdManager;
import org.teiid.designer.ui.actions.ModelerActionService;
import org.teiid.designer.ui.actions.IModelerActionConstants.ModelerGlobalActions;
import org.teiid.designer.ui.common.actions.AbstractAction;
import org.teiid.designer.ui.common.actions.ControlledPopupMenuExtender;
import org.teiid.designer.ui.common.actions.GlobalActionsMap;
import org.teiid.designer.ui.common.actions.IActionConstants.EclipseGlobalActions;
import org.teiid.designer.ui.editors.ModelEditorPage;
import org.teiid.designer.ui.editors.ModelEditorSite;


/**
Expand All @@ -76,7 +71,7 @@ public class TransformationActionAdapter extends DiagramActionAdapter
// ============================================================================================================================
// Variables

private List modelObjectContributors;
private List<Object> modelObjectContributors;

// our specific actions
private AddTransformationSourceAction addSourcesAction;
Expand Down Expand Up @@ -451,7 +446,6 @@ public void contributeToMenuManager( IMenuManager theMenuMgr,
theMenuMgr.add(copyMenu);
theMenuMgr.add(new Separator());
}
addExtendedActions(theMenuMgr);
}
break;

Expand Down Expand Up @@ -483,7 +477,6 @@ public void contributeToMenuManager( IMenuManager theMenuMgr,
theMenuMgr.add(copyMenu);
theMenuMgr.add(new Separator());
}
addExtendedActions(theMenuMgr);
}
break;

Expand Down Expand Up @@ -596,7 +589,6 @@ public void contributeToMenuManager( IMenuManager theMenuMgr,
IAction existingAction = getAction(ModelerGlobalActions.OPEN);
if (existingAction != null) theMenuMgr.add(existingAction);
theMenuMgr.add(new Separator(ContextMenu.TRANS_END));
addExtendedActions(theMenuMgr);
}
break;
case TransformationSelectionHelper.TYPE_SOURCE_TABLE: {
Expand All @@ -609,7 +601,6 @@ public void contributeToMenuManager( IMenuManager theMenuMgr,
addExternalExportedActions(theMenuMgr, selection);
}
theMenuMgr.add(new Separator(ContextMenu.TRANS_END));
addExtendedActions(theMenuMgr);
}
break;
case TransformationSelectionHelper.TYPE_SQL_TRANSFORMATION_ROOT: {
Expand Down Expand Up @@ -643,25 +634,9 @@ public void contributeToMenuManager( IMenuManager theMenuMgr,

}

private void addExtendedActions( IMenuManager theMenuMgr ) {
ISelectionProvider selProvider = getEditorPage().getModelObjectSelectionProvider();
if (selProvider != null) {
if (theMenuMgr.find(IModelerActionConstants.ContextMenu.ADDITIONS) == null) {
theMenuMgr.add(new Separator(IModelerActionConstants.ContextMenu.ADDITIONS));
}
// Need to create a PopupMenuExtender to include any external actions here
IEditorPart editor = ((ModelEditorSite)getEditorPage().getEditorSite()).getEditor();
ControlledPopupMenuExtender popupMenuExtender = new ControlledPopupMenuExtender(ContextMenu.DIAGRAM_EDITOR_PAGE,
(MenuManager)theMenuMgr, selProvider,
editor);
popupMenuExtender.menuAboutToShow(theMenuMgr);
}

}

private void addExternalExportedActions( IMenuManager theMenuMgr,
ISelection selection ) {
List contributors = getModelObjectActionContributors();
List<Object> contributors = getModelObjectActionContributors();

for (int size = contributors.size(), i = 0; i < size; i++) {
IModelObjectActionContributor contributor = (IModelObjectActionContributor)contributors.get(i);
Expand Down Expand Up @@ -901,7 +876,7 @@ private MenuManager getModelingActionMenu( ISelection theSelection ) {
*
* @return the list of <code>IModelObjectActionContributor</code> implementations
*/
private List getModelObjectActionContributors() {
private List<Object> getModelObjectActionContributors() {
if (modelObjectContributors == null) {
String ID = org.teiid.designer.ui.UiConstants.ExtensionPoints.ModelObjectActionContributor.ID;
String CLASSNAME = org.teiid.designer.ui.UiConstants.ExtensionPoints.ModelObjectActionContributor.CLASSNAME;
Expand All @@ -913,7 +888,7 @@ private List getModelObjectActionContributors() {
IExtension[] extensions = extensionPoint.getExtensions();

if (extensions.length > 0) {
modelObjectContributors = new ArrayList(extensions.length);
modelObjectContributors = new ArrayList<Object>(extensions.length);

// for each extension get their contributor
for (int i = 0; i < extensions.length; i++) {
Expand Down Expand Up @@ -942,7 +917,7 @@ private List getModelObjectActionContributors() {
}
}
} else {
modelObjectContributors = Collections.EMPTY_LIST;
modelObjectContributors = Collections.emptyList();
}
}

Expand Down

0 comments on commit d9df0c8

Please sign in to comment.