1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 06:45:43 +02:00

[225509][api][breaking] RSE useractions API leaks non-API types (apply patch from Xuan Chen)

This commit is contained in:
Martin Oberhuber 2008-05-06 07:41:11 +00:00
parent bfdd68937f
commit 9b6fcf7ebd
14 changed files with 171 additions and 99 deletions

View file

@ -12,7 +12,7 @@ feature@org.eclipse.rse.ssh=v20080505,:pserver:anonymous:none@dev.eclipse.org:/c
feature@org.eclipse.rse.telnet=v20080411,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.telnet-feature
feature@org.eclipse.rse.terminals=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.terminals-feature
feature@org.eclipse.rse.tests=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/tests/org.eclipse.rse.tests-feature
feature@org.eclipse.rse.useractions=v20080409,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.useractions-feature
feature@org.eclipse.rse.useractions=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/features/org.eclipse.rse.useractions-feature
plugin@org.eclipse.dstore.core=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.dstore.core
plugin@org.eclipse.dstore.doc.isv=v20080411,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/doc/org.eclipse.dstore.doc.isv
plugin@org.eclipse.dstore.extra=v20080406,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.dstore.extra
@ -61,4 +61,4 @@ plugin@org.eclipse.rse.terminals.ui=v20080505,:pserver:anonymous:none@dev.eclips
plugin@org.eclipse.rse.tests=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/tests/org.eclipse.rse.tests
plugin@org.eclipse.rse.tests.framework=v20080331,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/tests/org.eclipse.rse.tests.framework
plugin@org.eclipse.rse.ui=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.ui
plugin@org.eclipse.rse.useractions=v20080409,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions
plugin@org.eclipse.rse.useractions=v20080505,:pserver:anonymous:none@dev.eclipse.org:/cvsroot/dsdp,,org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions

View file

@ -21,6 +21,10 @@ Require-Bundle: org.eclipse.core.resources,
Bundle-ActivationPolicy: lazy
Eclipse-LazyStart: true
Export-Package: org.eclipse.rse.internal.useractions;x-internal:=true,
org.eclipse.rse.internal.useractions.api.files.compile;x-internal:=true,
org.eclipse.rse.internal.useractions.api.files.uda;x-internal:=true,
org.eclipse.rse.internal.useractions.api.ui.compile;x-internal:=true,
org.eclipse.rse.internal.useractions.api.ui.uda;x-internal:=true,
org.eclipse.rse.internal.useractions.files.compile;x-internal:=true,
org.eclipse.rse.internal.useractions.files.uda;x-internal:=true,
org.eclipse.rse.internal.useractions.ui;x-internal:=true,
@ -28,10 +32,6 @@ Export-Package: org.eclipse.rse.internal.useractions;x-internal:=true,
org.eclipse.rse.internal.useractions.ui.uda;x-internal:=true,
org.eclipse.rse.internal.useractions.ui.uda.actions;x-internal:=true,
org.eclipse.rse.internal.useractions.ui.uda.util;x-internal:=true,
org.eclipse.rse.internal.useractions.ui.validators;x-internal:=true,
org.eclipse.rse.useractions.files.compile,
org.eclipse.rse.useractions.files.uda,
org.eclipse.rse.useractions.ui.compile,
org.eclipse.rse.useractions.ui.uda
org.eclipse.rse.internal.useractions.ui.validators;x-internal:=true
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.4

View file

@ -7,7 +7,7 @@
<menuContribution locationURI="popup:org.eclipse.rse.ui.view.systemView">
<menu id="org.eclipse.rse.ui.useractions.compile.menu"
label="%DynamicLabel.CompileActionNode">
<dynamic class="org.eclipse.rse.useractions.ui.compile.SystemDynamicCompileMenu"
<dynamic class="org.eclipse.rse.internal.useractions.api.ui.compile.SystemDynamicCompileMenu"
id="org.eclipse.ui.rse.ui.views.dynamiccompilemenu">
</dynamic>
<visibleWhen>
@ -24,7 +24,7 @@
</menu>
<menu id="org.eclipse.rse.ui.useractions.useraction.menu"
label="%DynamicLabel.UserActionNode">
<dynamic class="org.eclipse.rse.useractions.ui.uda.SystemDynamicUserActionMenu"
<dynamic class="org.eclipse.rse.internal.useractions.api.ui.uda.SystemDynamicUserActionMenu"
id="org.eclipse.ui.rse.ui.views.dynamicuseractionmenu">
</dynamic>
<visibleWhen>

View file

@ -1,18 +1,26 @@
/*********************************************************************************
* Copyright (c) 2008 IBM Corporation. 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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*
* Contributors:
* Xuan Chen (IBM) - [222470] initial contribution.
*********************************************************************************/
package org.eclipse.rse.useractions.files.compile;
package org.eclipse.rse.internal.useractions.api.files.compile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileManager;
/**
* Compile Manager Adapter Interface.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public interface ISystemCompileManagerAdapter {
public SystemCompileManager getSystemCompileManager(ISubSystemConfiguration ssc);

View file

@ -1,13 +1,13 @@
/*********************************************************************************
* Copyright (c) 2008 IBM Corporation. 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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*
* Contributors:
* Xuan Chen (IBM) - [222470] initial contribution.
*********************************************************************************/
package org.eclipse.rse.useractions.files.compile;
package org.eclipse.rse.internal.useractions.api.files.compile;
import java.util.HashMap;
@ -15,13 +15,22 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.files.compile.UniversalCompileManager;
import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileManager;
/**
* Universal Compile Manager Adapter.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class UniversalCompileManagerAdapter implements
ISystemCompileManagerAdapter {
private HashMap compileManagers = new HashMap();
public SystemCompileManager getSystemCompileManager(ISubSystemConfiguration ssc) {
String configID = ssc.getId();
SystemCompileManager thisCompileManager = (SystemCompileManager)compileManagers.get(configID);
if (thisCompileManager == null)
{
@ -29,7 +38,7 @@ public class UniversalCompileManagerAdapter implements
thisCompileManager.setSubSystemFactory(ssc);
compileManagers.put(configID, thisCompileManager);
}
return thisCompileManager;
}

View file

@ -1,18 +1,27 @@
/*********************************************************************************
* Copyright (c) 2008 IBM Corporation. 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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*
* Contributors:
* Xuan Chen (IBM) - [222470] initial contribution.
*********************************************************************************/
package org.eclipse.rse.useractions.files.uda;
package org.eclipse.rse.internal.useractions.api.files.uda;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionSubsystem;
/**
* User-defined Action Subsystem Adapter Interface.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public interface ISystemUDActionSubsystemAdapter {
public SystemUDActionSubsystem getSystemUDActionSubsystem(ISubSystemConfiguration ssc);

View file

@ -1,13 +1,13 @@
/*********************************************************************************
* Copyright (c) 2008 IBM Corporation. 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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*
* Contributors:
* Xuan Chen (IBM) - [222470] initial contribution.
*********************************************************************************/
package org.eclipse.rse.useractions.files.uda;
package org.eclipse.rse.internal.useractions.api.files.uda;
import java.util.HashMap;
@ -15,12 +15,21 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.files.uda.UDActionSubsystemUniversalFiles;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionSubsystem;
/**
* Universal User-defined Action Subsystem Adapter.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class UniversalSystemUDActionSubsystemAdapter implements ISystemUDActionSubsystemAdapter {
private HashMap uDActionSubsystems = new HashMap();
public SystemUDActionSubsystem getSystemUDActionSubsystem(ISubSystemConfiguration ssc) {
String configID = ssc.getId();
SystemUDActionSubsystem thisuDActionSubsystem = (SystemUDActionSubsystem)uDActionSubsystems.get(configID);
if (thisuDActionSubsystem == null)
{
@ -28,7 +37,7 @@ public class UniversalSystemUDActionSubsystemAdapter implements ISystemUDActionS
thisuDActionSubsystem.setSubSystemFactory(ssc);
uDActionSubsystems.put(configID, thisuDActionSubsystem);
}
return thisuDActionSubsystem;
}

View file

@ -9,7 +9,7 @@
* IBM Corporation - initial API and implementation
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
*******************************************************************************/
package org.eclipse.rse.useractions.ui.compile;
package org.eclipse.rse.internal.useractions.api.ui.compile;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@ -28,6 +28,12 @@ import org.eclipse.swt.widgets.Shell;
/**
* Cascading Compile-> menu for remote compilable resources.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class SystemCascadingCompileAction extends SystemBaseSubMenuAction implements IMenuListener {
private boolean isPrompt;

View file

@ -8,10 +8,10 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David Dykstal (IBM) - [186589] move user actions API out of org.eclipse.rse.ui
* David Dykstal (IBM) - [186589] move user actions API out of org.eclipse.rse.ui
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
*******************************************************************************/
package org.eclipse.rse.useractions.ui.compile;
package org.eclipse.rse.internal.useractions.api.ui.compile;
import java.util.ArrayList;
import java.util.List;
@ -38,15 +38,22 @@ import org.eclipse.ui.model.AdaptableList;
import org.eclipse.ui.model.WorkbenchContentProvider;
/**
* This is the action for an individual compile command, either prompted or not prompted.
* The label for the action is simply the compile command's label. If promptable, then "..." is appended.
* This is the action for an individual compile command, either prompted or not
* prompted. The label for the action is simply the compile command's label. If
* promptable, then "..." is appended.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class SystemCompileAction extends SystemBaseAction {
private SystemCompileCommand compileCmd;
private boolean isPrompt;
/**
* Constructor
* Constructor
*/
public SystemCompileAction(Shell shell, SystemCompileCommand compileCommand, boolean isPrompt) {
super(

View file

@ -1,13 +1,13 @@
/*********************************************************************************
* Copyright (c) 2008 IBM Corporation. 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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*
* Contributors:
* Xuan Chen (IBM) - [222470] initial contribution.
*********************************************************************************/
package org.eclipse.rse.useractions.ui.compile;
package org.eclipse.rse.internal.useractions.api.ui.compile;
import java.util.ArrayList;
@ -22,6 +22,7 @@ import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.api.files.compile.ISystemCompileManagerAdapter;
import org.eclipse.rse.internal.useractions.files.compile.UniversalCompileManager;
import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommand;
import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileManager;
@ -31,25 +32,33 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
import org.eclipse.rse.useractions.files.compile.ISystemCompileManagerAdapter;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CompoundContributionItem;
public class SystemDynamicCompileMenu extends CompoundContributionItem
/**
* Dynamic Compile Menu.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class SystemDynamicCompileMenu extends CompoundContributionItem
{
private class TestContribution extends ActionContributionItem {
public TestContribution(Action action)
{
super(action);
}
/*
public void fill(Menu menu, int index)
public void fill(Menu menu, int index)
{
MenuItem menuItem = new MenuItem(menu, SWT.RADIO);
menuItem.setText("My First Contribution");
}
@ -57,9 +66,9 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
}
protected IContributionItem[] getContributionItems() {
ArrayList returnedItemList = new ArrayList();
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ISelection selection = window.getSelectionService().getSelection();
@ -69,13 +78,13 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
return new IContributionItem[0];
}
Shell shell = SystemBasePlugin.getActiveWorkbenchShell();
ISystemRemoteElementAdapter rmtAdapter = SystemAdapterHelpers.getRemoteAdapter(firstSelection);
ISubSystem subsystem = rmtAdapter.getSubSystem(firstSelection);
ISubSystemConfiguration ssc = subsystem.getSubSystemConfiguration();
SystemCompileManager compileManager = null;
if (firstSelection instanceof IAdaptable) {
ISystemCompileManagerAdapter adapter = (ISystemCompileManagerAdapter)((IAdaptable)firstSelection).getAdapter(ISystemCompileManagerAdapter.class);
if (null != adapter)
@ -83,13 +92,13 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
compileManager = adapter.getSystemCompileManager(ssc);
}
}
if (null == compileManager)
{
compileManager = new UniversalCompileManager();
compileManager.setSubSystemFactory(ssc);
}
for (int idx = 0; idx < activeProfiles.length; idx++)
{
String srcType = null;
@ -99,15 +108,15 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
srcType = "null"; //$NON-NLS-1$
else if (srcType.equals("")) //$NON-NLS-1$
srcType = "blank"; //$NON-NLS-1$
}
}
if (null != compileManager)
{
SystemCompileManager thisCompileManager = compileManager;
SystemCompileProfile compileProfile = thisCompileManager.getCompileProfile(activeProfiles[idx]);
// compileProfile.addContributions(firstSelection);
SystemCompileType compileType = compileProfile.getCompileType(srcType);
if (compileType != null)
{
SystemCompileCommand[] cmds = compileType.getCompileCommandsArray();
@ -121,15 +130,15 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
}
}
}
}
// add a separator before Work With Compile Commands... menu item
//ourSubMenu.add(new Separator());
// add Work With Commands... action
if (returnedItemList.size() > 0)
returnedItemList.add(new Separator());
if (returnedItemList.size() > 0)
returnedItemList.add(new Separator());
// Here's where you would dynamically generate your list
SystemWorkWithCompileCommandsAction workWithCompileCommandAction = new SystemWorkWithCompileCommandsAction(shell, true, subsystem, compileManager);
workWithCompileCommandAction.setSelection(selection);
@ -143,4 +152,4 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem
return list;
}
}
}

View file

@ -12,7 +12,7 @@
* API to the user actions plugin
* Xuan Chen (IBM) - [225617] [useraction][api] Remove Team view support inside user action.
*******************************************************************************/
package org.eclipse.rse.useractions.ui.compile;
package org.eclipse.rse.internal.useractions.api.ui.compile;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.dialogs.Dialog;
@ -21,6 +21,7 @@ import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.IUserActionsImageIds;
import org.eclipse.rse.internal.useractions.api.files.compile.ISystemCompileManagerAdapter;
import org.eclipse.rse.internal.useractions.files.compile.UniversalCompileManager;
import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileManager;
import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileProfile;
@ -31,19 +32,24 @@ import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
import org.eclipse.rse.useractions.files.compile.ISystemCompileManagerAdapter;
import org.eclipse.swt.widgets.Shell;
/**
* The action that displays the Work With -> Compile Commands menu item
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction {
private ISubSystem subsystem = null;
private ISubSystemConfiguration subsystemFactory = null;
private ISystemProfile profile = null;
private SystemCompileManager compileManager = null;
/**
* Constructor
* @param shell The Shell of the parent UI for this dialog
@ -61,7 +67,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
setHelp(RSEUIPlugin.HELPPREFIX + "actnwwcc"); //$NON-NLS-1$
setAvailableOffline(true);
}
public SystemWorkWithCompileCommandsAction(Shell shell, boolean fromCascadingCompileAction, ISubSystem subSystem, SystemCompileManager compileManager)
{
this(shell, fromCascadingCompileAction);
@ -72,7 +78,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
subsystemFactory = subsystem.getSubSystemConfiguration();
profile = subSystem.getSystemProfile();
}
}
/**
@ -117,7 +123,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
subsystemFactory = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getSubSystemConfiguration();
profile = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getProfile();
}
*/
*/
else {
ISystemRemoteElementAdapter rmtAdapter = SystemAdapterHelpers.getRemoteAdapter(inputObject);
if (rmtAdapter != null) subsystem = rmtAdapter.getSubSystem(inputObject);
@ -130,9 +136,9 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
if (subsystemFactory == null) subsystemFactory = subsystem.getSubSystemConfiguration();
if (profile == null) profile = subsystem.getSystemProfile();
}
if (null == compileManager)
{
if (null == compileManager)
{
if (inputObject instanceof IAdaptable) {
ISystemCompileManagerAdapter adapter = (ISystemCompileManagerAdapter)((IAdaptable)inputObject).getAdapter(ISystemCompileManagerAdapter.class);
if (null != adapter)
@ -141,13 +147,13 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
}
}
}
if (null == compileManager)
{
compileManager = new UniversalCompileManager();
compileManager.setSubSystemFactory(subsystemFactory);
}
if (null != compileManager)
{
if (profile != null)
@ -155,9 +161,9 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
currProfile = compileManager.getCompileProfile(profile);
currProfiles = compileManager.getAllCompileProfiles();
}
caseSensitive = subsystemFactory.isCaseSensitive();
SystemWorkWithCompileCommandsDialog dlg = new SystemWorkWithCompileCommandsDialog(shell, compileManager, currProfile);
/* FIXME - currProfiles cannot be null since above stuff was commented out
if (currProfiles != null) {
@ -166,7 +172,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
*/
dlg.setProfiles(currProfiles);
dlg.setCaseSensitive(caseSensitive);
return dlg;
}
return null;

View file

@ -1,13 +1,13 @@
/*********************************************************************************
* Copyright (c) 2008 IBM Corporation. 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
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
*
* Contributors:
* Xuan Chen (IBM) - [222470] initial contribution.
*********************************************************************************/
package org.eclipse.rse.useractions.ui.uda;
package org.eclipse.rse.internal.useractions.api.ui.uda;
import java.util.ArrayList;
@ -22,6 +22,7 @@ import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.api.files.uda.ISystemUDActionSubsystemAdapter;
import org.eclipse.rse.internal.useractions.files.uda.UDActionSubsystemUniversalFiles;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionSubsystem;
@ -30,25 +31,33 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
import org.eclipse.rse.useractions.files.uda.ISystemUDActionSubsystemAdapter;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CompoundContributionItem;
public class SystemDynamicUserActionMenu extends CompoundContributionItem
/**
* Dynamic User-defined Action Menu.
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as part
* of a work in progress. There is no guarantee that this API will work or that
* it will remain the same. Please do not use this API without consulting with
* the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* </p>
*/
public class SystemDynamicUserActionMenu extends CompoundContributionItem
{
private class UserActionContribution extends ActionContributionItem {
public UserActionContribution(Action action)
{
super(action);
}
/*
public void fill(Menu menu, int index)
public void fill(Menu menu, int index)
{
MenuItem menuItem = new MenuItem(menu, SWT.RADIO);
menuItem.setText("My First Contribution");
}
@ -56,9 +65,9 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem
}
protected IContributionItem[] getContributionItems() {
ArrayList returnedItemList = new ArrayList();
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ISelection selection = window.getSelectionService().getSelection();
@ -68,12 +77,12 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem
return new IContributionItem[0];
}
ISystemRemoteElementAdapter rmtAdapter = SystemAdapterHelpers.getRemoteAdapter(firstSelection);
ISubSystem subsystem = rmtAdapter.getSubSystem(firstSelection);
ISubSystemConfiguration ssc = subsystem.getSubSystemConfiguration();
SystemUDActionSubsystem systemUDActionSubsystem = null;
if (firstSelection instanceof IAdaptable) {
ISystemUDActionSubsystemAdapter adapter = (ISystemUDActionSubsystemAdapter)((IAdaptable)firstSelection).getAdapter(ISystemUDActionSubsystemAdapter.class);
if (null != adapter)
@ -82,14 +91,14 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem
systemUDActionSubsystem.setSubsystem(subsystem);
}
}
if (null == systemUDActionSubsystem)
{
systemUDActionSubsystem = new UDActionSubsystemUniversalFiles();
systemUDActionSubsystem.setSubSystemFactory(ssc);
systemUDActionSubsystem.setSubsystem(subsystem);
}
Shell shell = SystemBasePlugin.getActiveWorkbenchShell();
for (int idx = 0; idx < activeProfiles.length; idx++)
{
@ -98,7 +107,7 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem
if (null != systemUDActionSubsystem)
{
Action[] list = systemUDActionSubsystem.addUserActions(null, (IStructuredSelection)selection, activeProfiles[idx], shell);
for (int i = 0; i < list.length; i++)
{
UserActionContribution testContribution = new UserActionContribution(list[i]);
@ -106,13 +115,13 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem
}
}
}
// add a separator before Work With Compile Commands... menu item
//ourSubMenu.add(new Separator());
// add Work With Commands... action
if (returnedItemList.size() > 0)
returnedItemList.add(new Separator());
returnedItemList.add(new Separator());
SystemWorkWithUDAsAction wwAction;
wwAction = new SystemWorkWithUDAsAction(shell, systemUDActionSubsystem.getSubsystem(), systemUDActionSubsystem);
wwAction.setText(SystemUDAResources.RESID_WORKWITH_UDAS_ACTION_LABEL);
@ -121,9 +130,9 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem
wwAction.setSelection(selection);
UserActionContribution userActionContribution = new UserActionContribution(wwAction);
returnedItemList.add(userActionContribution);
IContributionItem[] list = (IContributionItem[])returnedItemList.toArray(new IContributionItem[]{});
return list;
}
}
}

View file

@ -20,6 +20,8 @@ import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
import org.eclipse.rse.internal.useractions.api.files.compile.ISystemCompileManagerAdapter;
import org.eclipse.rse.internal.useractions.api.ui.compile.SystemCompileAction;
import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.ISystemViewMenuListener;
@ -27,8 +29,6 @@ import org.eclipse.rse.ui.actions.SystemBaseDummyAction;
import org.eclipse.rse.ui.actions.SystemBaseSubMenuAction;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
import org.eclipse.rse.useractions.files.compile.ISystemCompileManagerAdapter;
import org.eclipse.rse.useractions.ui.compile.SystemCompileAction;
import org.eclipse.swt.widgets.Shell;
/**

View file

@ -25,6 +25,7 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.UserActionsPersistenceUtil;
import org.eclipse.rse.internal.useractions.api.ui.compile.SystemCascadingCompileAction;
import org.eclipse.rse.internal.useractions.ui.SystemCmdSubstVarList;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
@ -36,7 +37,6 @@ import org.eclipse.rse.ui.SystemMenuManager;
import org.eclipse.rse.ui.messages.SystemMessageDialog;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
import org.eclipse.rse.ui.view.SystemAdapterHelpers;
import org.eclipse.rse.useractions.ui.compile.SystemCascadingCompileAction;
import org.eclipse.swt.widgets.Shell;
/**