JBoss Tools SVN: r39267 - branches/jbosstools-3.3.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-03-02 12:56:57 -0500 (Fri, 02 Mar 2012)
New Revision: 39267
Modified:
branches/jbosstools-3.3.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java
Log:
JBIDE-10473 patch to beta1 branch (classpath container for as70)
Modified: branches/jbosstools-3.3.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/…
[View More]runtime/CustomRuntimeClasspathModel.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java 2012-03-02 16:59:43 UTC (rev 39266)
+++ branches/jbosstools-3.3.0.Beta1/as/plugins/org.jboss.ide.eclipse.as.classpath.core/src/org/jboss/ide/eclipse/as/classpath/core/runtime/CustomRuntimeClasspathModel.java 2012-03-02 17:56:57 UTC (rev 39267)
@@ -185,14 +185,12 @@
sets.add(new PathProviderFileset("modules/org/jboss/resteasy/resteasy-jaxrs/main"));
sets.add(new PathProviderFileset("modules/org/jboss/resteasy/resteasy-multipart-provider/main"));
+ sets.add(new PathProviderFileset("modules/org/jboss/ejb3/main"));
return (IDefaultPathProvider[]) sets.toArray(new IDefaultPathProvider[sets.size()]);
}
public IDefaultPathProvider[] getDefaultAS71Entries() {
- ArrayList<IDefaultPathProvider> sets = new ArrayList<IDefaultPathProvider>();
- sets.addAll(Arrays.asList(getDefaultAS70Entries()));
- sets.add(new PathProviderFileset("modules/org/jboss/ejb3/main"));
- return (IDefaultPathProvider[]) sets.toArray(new IDefaultPathProvider[sets.size()]);
+ return getDefaultAS70Entries();
}
public IPath[] getAllEntries(IRuntime runtime, IDefaultPathProvider[] sets) {
[View Less]
12 years, 10 months
JBoss Tools SVN: r39266 - trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-03-02 11:59:43 -0500 (Fri, 02 Mar 2012)
New Revision: 39266
Modified:
trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java
Log:
JBIDE-11128: Forge: cd command opens Remote Systems view and activates it
Modified: trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java
===================================================================
--- trunk/forge/…
[View More]plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java 2012-03-02 16:58:54 UTC (rev 39265)
+++ trunk/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java 2012-03-02 16:59:43 UTC (rev 39266)
@@ -54,13 +54,6 @@
private void show(IFileStore fileStore) {
IWorkbenchPage workbenchPage = ForgeCommandPostProcessorHelper.getActiveWorkbenchPage();
IViewPart remoteSystemView = workbenchPage.findView("org.eclipse.rse.ui.view.systemView");
- if (remoteSystemView == null) {
- try {
- remoteSystemView = workbenchPage.showView("org.eclipse.rse.ui.view.systemView");
- } catch (PartInitException e) {
- ForgeUIPlugin.log(e);
- }
- }
if (remoteSystemView != null) {
expandInRemoteSystemView(remoteSystemView, fileStore);
}
[View Less]
12 years, 10 months
JBoss Tools SVN: r39265 - branches/jbosstools-3.3.0.Beta1/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2012-03-02 11:58:54 -0500 (Fri, 02 Mar 2012)
New Revision: 39265
Modified:
branches/jbosstools-3.3.0.Beta1/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java
Log:
JBIDE-11128: Forge: cd command opens Remote Systems view and activates it
Modified: branches/jbosstools-3.3.0.Beta1/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java
=====================================…
[View More]==============================
--- branches/jbosstools-3.3.0.Beta1/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java 2012-03-02 16:37:24 UTC (rev 39264)
+++ branches/jbosstools-3.3.0.Beta1/forge/plugins/org.jboss.tools.forge.ui/src/org/jboss/tools/forge/ui/console/CdPostProcessor.java 2012-03-02 16:58:54 UTC (rev 39265)
@@ -54,13 +54,6 @@
private void show(IFileStore fileStore) {
IWorkbenchPage workbenchPage = ForgeCommandPostProcessorHelper.getActiveWorkbenchPage();
IViewPart remoteSystemView = workbenchPage.findView("org.eclipse.rse.ui.view.systemView");
- if (remoteSystemView == null) {
- try {
- remoteSystemView = workbenchPage.showView("org.eclipse.rse.ui.view.systemView");
- } catch (PartInitException e) {
- ForgeUIPlugin.log(e);
- }
- }
if (remoteSystemView != null) {
expandInRemoteSystemView(remoteSystemView, fileStore);
}
[View Less]
12 years, 10 months
JBoss Tools SVN: r39262 - in trunk/maven/plugins/org.jboss.tools.maven.profiles.ui: src/org/jboss/tools/maven/profiles/ui/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-03-02 10:28:07 -0500 (Fri, 02 Mar 2012)
New Revision: 39262
Added:
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml
Log:
JBIDE-11120 : copy GenericCommandActionDelegate.java here to fix Maven Profile selection
Modified: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml
===================…
[View More]================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml 2012-03-02 15:26:45 UTC (rev 39261)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml 2012-03-02 15:28:07 UTC (rev 39262)
@@ -33,7 +33,7 @@
objectClass="org.eclipse.core.resources.IProject"
adaptable="true">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ class="org.jboss.tools.maven.profiles.ui.internal.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
@@ -51,7 +51,7 @@
objectClass="org.eclipse.core.resources.IFile"
adaptable="true">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ class="org.jboss.tools.maven.profiles.ui.internal.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
@@ -66,7 +66,7 @@
adaptable="true"
objectClass="org.eclipse.ui.IWorkingSet">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ class="org.jboss.tools.maven.profiles.ui.internal.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
Added: trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java 2012-03-02 15:28:07 UTC (rev 39262)
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Red Hat - minor refactoring
+ *
+ * Original code taken from <a href="http://wiki.eclipse.org/Platform_Command_Framework#Using_an_IActionDelega...">
+ * http://wiki.eclipse.org/Platform_Command_Framework#Using_an_IActionDelega...</a>
+ ******************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+
+/**
+ * This action delegate can be used to specify a command with or without
+ * parameters be called from an <action/> specified in actionSets,
+ * editorActions, viewActions, or popupMenus.
+ */
+public class GenericCommandActionDelegate implements
+ IWorkbenchWindowActionDelegate, IViewActionDelegate,
+ IEditorActionDelegate, IObjectActionDelegate, IExecutableExtension {
+
+ /**
+ * The commandId parameter needed when using the <class/> form for
+ * this IActionDelegate. Value is "commandId".
+ */
+ public static final String PARM_COMMAND_ID = "commandId"; //$NON-NLS-1$
+
+ private String commandId = null;
+
+ private Map<?, ?> parameterMap = null;
+
+ private ParameterizedCommand parameterizedCommand = null;
+
+ private IHandlerService handlerService = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ handlerService = null;
+ parameterizedCommand = null;
+ parameterMap = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if (handlerService == null) {
+ // what, no handler service ... no problem
+ return;
+ }
+ try {
+ if (commandId != null) {
+ handlerService.executeCommand(commandId, null);
+ } else if (parameterizedCommand != null) {
+ handlerService.executeCommand(parameterizedCommand, null);
+ }
+ // else there is no command for this delegate
+ } catch (Exception e) {
+ // exceptions reduced for brevity
+ // and we won't just do a print out :-)
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ // we don't care, handlers get their selection from the
+ // ExecutionEvent application context
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
+ * java.lang.String, java.lang.Object)
+ */
+ public void setInitializationData(IConfigurationElement config,
+ String propertyName, Object data) throws CoreException {
+ String id = config.getAttribute(IWorkbenchRegistryConstants.ATT_ID);
+ // save the data until our init(*) call, where we can get
+ // the services.
+ if (data instanceof String) {
+ commandId = (String) data;
+ } else if (data instanceof Map) {
+ parameterMap = (Map<?, ?>) data;
+ if (parameterMap.get(PARM_COMMAND_ID) == null) {
+ Status status = new Status(IStatus.ERROR,
+ "org.jboss.tools.maven.ui.generic", "The '" + id
+ + "' action won't work without a commandId");
+ throw new CoreException(status);
+ }
+ } else {
+ Status status = new Status(
+ IStatus.ERROR,
+ "org.jboss.tools.maven.ui.generic",
+ "The '"
+ + id
+ + "' action won't work without some initialization parameters");
+ throw new CoreException(status);
+ }
+ }
+
+ /**
+ * Build a command from the executable extension information.
+ *
+ * @param commandService
+ * to get the Command object
+ */
+ private void createCommand(ICommandService commandService) {
+ String id = (String) parameterMap.get(PARM_COMMAND_ID);
+ if (id == null) {
+ return;
+ }
+ if (parameterMap.size() == 1) {
+ commandId = id;
+ return;
+ }
+ try {
+ Command cmd = commandService.getCommand(id);
+ if (!cmd.isDefined()) {
+ // command not defined? no problem ...
+ return;
+ }
+ ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
+ Iterator<?> i = parameterMap.keySet().iterator();
+ while (i.hasNext()) {
+ String parmName = (String) i.next();
+ if (PARM_COMMAND_ID.equals(parmName)) {
+ continue;
+ }
+ IParameter parm = cmd.getParameter(parmName);
+ if (parm == null) {
+ // asking for a bogus parameter? No problem
+ return;
+ }
+ parameters.add(new Parameterization(parm, (String) parameterMap
+ .get(parmName)));
+ }
+ parameterizedCommand = new ParameterizedCommand(cmd,
+ (Parameterization[]) parameters
+ .toArray(new Parameterization[parameters.size()]));
+ } catch (NotDefinedException e) {
+ // command is bogus? No problem, we'll do nothing.
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ if (handlerService != null) {
+ // already initialized
+ return;
+ }
+
+ handlerService = (IHandlerService) window
+ .getService(IHandlerService.class);
+ if (parameterMap != null) {
+ ICommandService commandService = (ICommandService) window
+ .getService(ICommandService.class);
+ createCommand(commandService);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ init(view.getSite().getWorkbenchWindow());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction,
+ * org.eclipse.ui.IEditorPart)
+ */
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ // we don't actually care about the active editor, since that
+ // information is in the ExecutionEvent application context
+ // but we need to make sure we're initialized.
+ if (targetEditor != null) {
+ init(targetEditor.getSite().getWorkbenchWindow());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
+ * org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // we don't actually care about the active part, since that
+ // information is in the ExecutionEvent application context
+ // but we need to make sure we're initialized.
+ if (targetPart != null) {
+ init(targetPart.getSite().getWorkbenchWindow());
+ }
+ }
+}
+
[View Less]
12 years, 10 months
JBoss Tools SVN: r39261 - in branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui: src/org/jboss/tools/maven/profiles/ui/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2012-03-02 10:26:45 -0500 (Fri, 02 Mar 2012)
New Revision: 39261
Added:
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java
Modified:
branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml
Log:
JBIDE-11120 : copy GenericCommandActionDelegate.java here to fix Maven Profile selection
Modified: branches/jbosstools-3.3.0.Beta1/…
[View More]maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml 2012-03-02 15:10:11 UTC (rev 39260)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/plugin.xml 2012-03-02 15:26:45 UTC (rev 39261)
@@ -33,7 +33,7 @@
objectClass="org.eclipse.core.resources.IProject"
adaptable="true">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ class="org.jboss.tools.maven.profiles.ui.internal.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
@@ -51,7 +51,7 @@
objectClass="org.eclipse.core.resources.IFile"
adaptable="true">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ class="org.jboss.tools.maven.profiles.ui.internal.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
@@ -66,7 +66,7 @@
adaptable="true"
objectClass="org.eclipse.ui.IWorkingSet">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
- class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
+ class="org.jboss.tools.maven.profiles.ui.internal.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
Added: branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java (rev 0)
+++ branches/jbosstools-3.3.0.Beta1/maven/plugins/org.jboss.tools.maven.profiles.ui/src/org/jboss/tools/maven/profiles/ui/internal/GenericCommandActionDelegate.java 2012-03-02 15:26:45 UTC (rev 39261)
@@ -0,0 +1,248 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Red Hat - minor refactoring
+ *
+ * Original code taken from <a href="http://wiki.eclipse.org/Platform_Command_Framework#Using_an_IActionDelega...">
+ * http://wiki.eclipse.org/Platform_Command_Framework#Using_an_IActionDelega...</a>
+ ******************************************************************************/
+package org.jboss.tools.maven.profiles.ui.internal;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IEditorActionDelegate;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IViewActionDelegate;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+
+/**
+ * This action delegate can be used to specify a command with or without
+ * parameters be called from an <action/> specified in actionSets,
+ * editorActions, viewActions, or popupMenus.
+ */
+public class GenericCommandActionDelegate implements
+ IWorkbenchWindowActionDelegate, IViewActionDelegate,
+ IEditorActionDelegate, IObjectActionDelegate, IExecutableExtension {
+
+ /**
+ * The commandId parameter needed when using the <class/> form for
+ * this IActionDelegate. Value is "commandId".
+ */
+ public static final String PARM_COMMAND_ID = "commandId"; //$NON-NLS-1$
+
+ private String commandId = null;
+
+ private Map<?, ?> parameterMap = null;
+
+ private ParameterizedCommand parameterizedCommand = null;
+
+ private IHandlerService handlerService = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+ */
+ public void dispose() {
+ handlerService = null;
+ parameterizedCommand = null;
+ parameterMap = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+ */
+ public void run(IAction action) {
+ if (handlerService == null) {
+ // what, no handler service ... no problem
+ return;
+ }
+ try {
+ if (commandId != null) {
+ handlerService.executeCommand(commandId, null);
+ } else if (parameterizedCommand != null) {
+ handlerService.executeCommand(parameterizedCommand, null);
+ }
+ // else there is no command for this delegate
+ } catch (Exception e) {
+ // exceptions reduced for brevity
+ // and we won't just do a print out :-)
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ public void selectionChanged(IAction action, ISelection selection) {
+ // we don't care, handlers get their selection from the
+ // ExecutionEvent application context
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData(org.eclipse.core.runtime.IConfigurationElement,
+ * java.lang.String, java.lang.Object)
+ */
+ public void setInitializationData(IConfigurationElement config,
+ String propertyName, Object data) throws CoreException {
+ String id = config.getAttribute(IWorkbenchRegistryConstants.ATT_ID);
+ // save the data until our init(*) call, where we can get
+ // the services.
+ if (data instanceof String) {
+ commandId = (String) data;
+ } else if (data instanceof Map) {
+ parameterMap = (Map<?, ?>) data;
+ if (parameterMap.get(PARM_COMMAND_ID) == null) {
+ Status status = new Status(IStatus.ERROR,
+ "org.jboss.tools.maven.ui.generic", "The '" + id
+ + "' action won't work without a commandId");
+ throw new CoreException(status);
+ }
+ } else {
+ Status status = new Status(
+ IStatus.ERROR,
+ "org.jboss.tools.maven.ui.generic",
+ "The '"
+ + id
+ + "' action won't work without some initialization parameters");
+ throw new CoreException(status);
+ }
+ }
+
+ /**
+ * Build a command from the executable extension information.
+ *
+ * @param commandService
+ * to get the Command object
+ */
+ private void createCommand(ICommandService commandService) {
+ String id = (String) parameterMap.get(PARM_COMMAND_ID);
+ if (id == null) {
+ return;
+ }
+ if (parameterMap.size() == 1) {
+ commandId = id;
+ return;
+ }
+ try {
+ Command cmd = commandService.getCommand(id);
+ if (!cmd.isDefined()) {
+ // command not defined? no problem ...
+ return;
+ }
+ ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
+ Iterator<?> i = parameterMap.keySet().iterator();
+ while (i.hasNext()) {
+ String parmName = (String) i.next();
+ if (PARM_COMMAND_ID.equals(parmName)) {
+ continue;
+ }
+ IParameter parm = cmd.getParameter(parmName);
+ if (parm == null) {
+ // asking for a bogus parameter? No problem
+ return;
+ }
+ parameters.add(new Parameterization(parm, (String) parameterMap
+ .get(parmName)));
+ }
+ parameterizedCommand = new ParameterizedCommand(cmd,
+ (Parameterization[]) parameters
+ .toArray(new Parameterization[parameters.size()]));
+ } catch (NotDefinedException e) {
+ // command is bogus? No problem, we'll do nothing.
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public void init(IWorkbenchWindow window) {
+ if (handlerService != null) {
+ // already initialized
+ return;
+ }
+
+ handlerService = (IHandlerService) window
+ .getService(IHandlerService.class);
+ if (parameterMap != null) {
+ ICommandService commandService = (ICommandService) window
+ .getService(ICommandService.class);
+ createCommand(commandService);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
+ */
+ public void init(IViewPart view) {
+ init(view.getSite().getWorkbenchWindow());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction,
+ * org.eclipse.ui.IEditorPart)
+ */
+ public void setActiveEditor(IAction action, IEditorPart targetEditor) {
+ // we don't actually care about the active editor, since that
+ // information is in the ExecutionEvent application context
+ // but we need to make sure we're initialized.
+ if (targetEditor != null) {
+ init(targetEditor.getSite().getWorkbenchWindow());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction,
+ * org.eclipse.ui.IWorkbenchPart)
+ */
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // we don't actually care about the active part, since that
+ // information is in the ExecutionEvent application context
+ // but we need to make sure we're initialized.
+ if (targetPart != null) {
+ init(targetPart.getSite().getWorkbenchWindow());
+ }
+ }
+}
+
[View Less]
12 years, 10 months
JBoss Tools SVN: r39260 - branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-03-02 10:10:11 -0500 (Fri, 02 Mar 2012)
New Revision: 39260
Modified:
branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java
Log:
[JBIDE-10479] updated dialog text to reflect that only Dynamic Web/Eclipse WTP projects may be selected
Modified: branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/…
[View More]tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java 2012-03-02 15:10:03 UTC (rev 39259)
+++ branches/jbosstools-3.3.0.Beta1/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java 2012-03-02 15:10:11 UTC (rev 39260)
@@ -35,7 +35,7 @@
super(shell, new ProjectLabelProvider());
setTitle("Select Existing Project");
setMessage(NLS.bind(
- "Select an existing project for {0}.\nOnly java projects can be used.",
+ "Select an existing project for {0}.\nOnly Dynamic Web/Eclipse WTP projects can be used.",
openShiftAppName));
setMultipleSelection(false);
setAllowDuplicates(false);
[View Less]
12 years, 10 months
JBoss Tools SVN: r39259 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-03-02 10:10:03 -0500 (Fri, 02 Mar 2012)
New Revision: 39259
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java
Log:
[JBIDE-10479] updated dialog text to reflect that only Dynamic Web/Eclipse WTP projects may be selected
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/…
[View More]SelectExistingProjectDialog.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java 2012-03-02 14:25:34 UTC (rev 39258)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java 2012-03-02 15:10:03 UTC (rev 39259)
@@ -35,7 +35,7 @@
super(shell, new ProjectLabelProvider());
setTitle("Select Existing Project");
setMessage(NLS.bind(
- "Select an existing project for {0}.\nOnly java projects can be used.",
+ "Select an existing project for {0}.\nOnly Dynamic Web/Eclipse WTP projects can be used.",
openShiftAppName));
setMultipleSelection(false);
setAllowDuplicates(false);
[View Less]
12 years, 10 months
JBoss Tools SVN: r39258 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2012-03-02 09:25:34 -0500 (Fri, 02 Mar 2012)
New Revision: 39258
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
Log:
[JBIDE-11132] removed recursion when resetting remote name. changed logic of …
[View More]resetting remote name to a simplistic one.
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-03-02 14:23:28 UTC (rev 39257)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPage.java 2012-03-02 14:25:34 UTC (rev 39258)
@@ -134,7 +134,6 @@
useDefaultRemoteNameButton = new Button(cloneGroup, SWT.CHECK);
useDefaultRemoteNameButton.setText("Use default remote name");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(3, 1).applyTo(useDefaultRemoteNameButton);
- useDefaultRemoteNameButton.addSelectionListener(onDefaultRemoteName());
this.remoteNameLabel = new Label(cloneGroup, SWT.NONE);
remoteNameLabel.setText("Remote name:");
@@ -205,16 +204,6 @@
};
}
- private SelectionListener onDefaultRemoteName() {
- return new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- pageModel.resetRemoteName();
- }
- };
- }
-
private SelectionAdapter onSshPrefs() {
return new SelectionAdapter() {
@@ -226,10 +215,6 @@
}
protected void onPageActivated(DataBindingContext dbc) {
- // allow to enable a proj only for as7 openshift applications
- // pageModel.resetRepositoryPath();
- pageModel.resetRemoteName();
- // pageModel.refreshApplicationName();
enableWidgets(pageModel.isNewProject());
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-03-02 14:23:28 UTC (rev 39257)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/GitCloningSettingsWizardPageModel.java 2012-03-02 14:25:34 UTC (rev 39258)
@@ -88,28 +88,11 @@
wizardModel.setRepositoryPath(repositoryPath));
}
- // public void resetRepositoryPath() {
- // if (wizardModel.isNewProject()
- // || getRepositoryPath() == null) {
- // setRepositoryPath(getDefaultRepositoryPath());
- // }
- // }
-
- public void resetRemoteName() {
+ private void resetRemoteName() {
if (!wizardModel.isNewProject()) {
- // if existing project and remote name is still 'origin'
- // -> switch to 'openshift' (leave as is if existing project and
- // remote name != 'origin')
- if (NEW_PROJECT_REMOTE_NAME_DEFAULT.equals(getRemoteName())) {
setRemoteName(EXISTING_PROJECT_REMOTE_NAME_DEFAULT);
- }
} else {
- // if new project and remote name is not 'origin'
- // -> restore 'origin'
- if (!NEW_PROJECT_REMOTE_NAME_DEFAULT.equals(getRemoteName())) {
- setUseDefaultRemoteName(true);
setRemoteName(NEW_PROJECT_REMOTE_NAME_DEFAULT);
- }
}
}
@@ -148,8 +131,6 @@
firePropertyChange(PROPERTY_USE_DEFAULT_REMOTE_NAME, useDefaultRemoteName,
this.useDefaultRemoteName = useDefaultRemoteName);
if (useDefaultRemoteName) {
- // setRemoteName(isNewProject() ? NEW_PROJECT_REMOTE_NAME_DEFAULT :
- // EXISTING_PROJECT_REMOTE_NAME_DEFAULT);
resetRemoteName();
}
}
[View Less]
12 years, 10 months