diff --git a/rse/plugins/org.eclipse.rse.useractions/plugin.properties b/rse/plugins/org.eclipse.rse.useractions/plugin.properties index 7990f1fce06..b377d10ea52 100644 --- a/rse/plugins/org.eclipse.rse.useractions/plugin.properties +++ b/rse/plugins/org.eclipse.rse.useractions/plugin.properties @@ -20,3 +20,6 @@ providerName = Eclipse.org PropertyPage.TeamViewUserActionNode = User Action Information PropertyPage.TeamViewCompileTypeNode = Compile Type Information PropertyPage.TeamViewCompileCommandNode = Compile Command Information + +DynamicLabel.CompileActionNode = Compile +DynamicLabel.UserActionNode = User Action diff --git a/rse/plugins/org.eclipse.rse.useractions/plugin.xml b/rse/plugins/org.eclipse.rse.useractions/plugin.xml index 658df2cc943..26d0db057cd 100644 --- a/rse/plugins/org.eclipse.rse.useractions/plugin.xml +++ b/rse/plugins/org.eclipse.rse.useractions/plugin.xml @@ -39,5 +39,24 @@ + + + + + + + + + + + + + diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/uda/actions/SystemWorkWithUDAsAction.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/uda/actions/SystemWorkWithUDAsAction.java index c430c493030..7bdbfcdb8f2 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/uda/actions/SystemWorkWithUDAsAction.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/uda/actions/SystemWorkWithUDAsAction.java @@ -155,12 +155,16 @@ public class SystemWorkWithUDAsAction extends SystemBaseDialogAction { //System.out.println("First selection: "+element); if ((subsystem == null) && (element instanceof ISubSystem)) { subsystem = (ISubSystem) element; - } else if ((subsystemFactory == null) && (element instanceof SystemTeamViewSubSystemConfigurationNode)) { + } + //Don't think we need to support invoking Work With User Action dialog from Team view + /* + else if ((subsystemFactory == null) && (element instanceof SystemTeamViewSubSystemConfigurationNode)) { SystemTeamViewSubSystemConfigurationNode ssfNode = (SystemTeamViewSubSystemConfigurationNode) element; subsystemFactory = ssfNode.getSubSystemConfiguration(); profile = ssfNode.getProfile(); //System.out.println("Profile is: "+profile); } + */ SystemWorkWithUDAsDialog dlg = null; if (subsystem != null) dlg = new SystemWorkWithUDAsDialog(parent, subsystem, udaActionSubsystem); diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemDynamicCompileMenu.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemDynamicCompileMenu.java index 01d50941db9..c3de1a20dd7 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemDynamicCompileMenu.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemDynamicCompileMenu.java @@ -21,6 +21,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.files.compile.UniversalCompileManager; import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommand; import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileManager; import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileProfile; @@ -68,10 +69,29 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem } 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) + { + compileManager = adapter.getSystemCompileManager(ssc); + } + } + + if (null == compileManager) + { + compileManager = new UniversalCompileManager(); + compileManager.setSubSystemFactory(ssc); + } + for (int idx = 0; idx < activeProfiles.length; idx++) { String srcType = null; - ISystemRemoteElementAdapter rmtAdapter = SystemAdapterHelpers.getRemoteAdapter(firstSelection); if (rmtAdapter != null) { srcType = rmtAdapter.getRemoteSourceType(firstSelection); if (srcType == null) @@ -79,21 +99,9 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem else if (srcType.equals("")) //$NON-NLS-1$ srcType = "blank"; //$NON-NLS-1$ } - 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) - { - compileManager = adapter.getSystemCompileManager(ssc); - } - } - - if (null != compileManager) - { + if (null != compileManager) + { SystemCompileManager thisCompileManager = compileManager; SystemCompileProfile compileProfile = thisCompileManager.getCompileProfile(activeProfiles[idx]); // compileProfile.addContributions(firstSelection); @@ -120,7 +128,7 @@ public class SystemDynamicCompileMenu extends CompoundContributionItem // add Work With Commands... action // Here's where you would dynamically generate your list - SystemWorkWithCompileCommandsAction workWithCompileCommandAction = new SystemWorkWithCompileCommandsAction(shell, true); + SystemWorkWithCompileCommandsAction workWithCompileCommandAction = new SystemWorkWithCompileCommandsAction(shell, true, subsystem, compileManager); workWithCompileCommandAction.setSelection(selection); TestContribution testContribution = new TestContribution(workWithCompileCommandAction); returnedItemList.add(testContribution); diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java index 8b906af4559..7275251d18a 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java @@ -21,11 +21,13 @@ import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode; import org.eclipse.rse.internal.useractions.IUserActionsImageIds; +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; import org.eclipse.rse.internal.useractions.ui.compile.SystemWorkWithCompileCommandsDialog; import org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileTypeNode; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; +import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionSubsystem; import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.actions.SystemBaseDialogAction; @@ -38,6 +40,12 @@ import org.eclipse.swt.widgets.Shell; * The action that displays the Work With -> Compile Commands menu item */ 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 @@ -55,6 +63,19 @@ 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); + this.subsystem = subSystem; + this.compileManager = compileManager; + if (null != subSystem) + { + subsystemFactory = subsystem.getSubSystemConfiguration(); + profile = subSystem.getSystemProfile(); + } + + } /** * Reset between runs @@ -94,52 +115,60 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction protected Dialog createDialog(Shell shell) { Object inputObject = getFirstSelection(); boolean caseSensitive = false; - ISubSystem subsystem = null; - ISubSystemConfiguration ssf = null; - ISystemProfile currSystemProfile = null; - if (inputObject instanceof ISubSystem) - subsystem = (ISubSystem) inputObject; - else if (inputObject instanceof SystemTeamViewCompileTypeNode) { - SystemTeamViewCompileTypeNode typeNode = ((SystemTeamViewCompileTypeNode) inputObject); - ssf = typeNode.getParentSubSystemFactory().getSubSystemConfiguration(); - currSystemProfile = typeNode.getProfile(); - } else if (inputObject instanceof SystemTeamViewSubSystemConfigurationNode) { - ssf = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getSubSystemConfiguration(); - currSystemProfile = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getProfile(); - } else { - ISystemRemoteElementAdapter rmtAdapter = SystemAdapterHelpers.getRemoteAdapter(inputObject); - if (rmtAdapter != null) subsystem = rmtAdapter.getSubSystem(inputObject); + if (null == subsystem) + { + if (inputObject instanceof ISubSystem) + subsystem = (ISubSystem) inputObject; + //Don't think we need to support invoking this diaglog from Team view. + /* + else if (inputObject instanceof SystemTeamViewCompileTypeNode) { + SystemTeamViewCompileTypeNode typeNode = ((SystemTeamViewCompileTypeNode) inputObject); + subsystemFactory = typeNode.getParentSubSystemFactory().getSubSystemConfiguration(); + profile = typeNode.getProfile(); + } else if (inputObject instanceof SystemTeamViewSubSystemConfigurationNode) { + subsystemFactory = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getSubSystemConfiguration(); + profile = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getProfile(); + } + */ + else { + ISystemRemoteElementAdapter rmtAdapter = SystemAdapterHelpers.getRemoteAdapter(inputObject); + if (rmtAdapter != null) subsystem = rmtAdapter.getSubSystem(inputObject); + } } SystemCompileProfile currProfile = null; SystemCompileProfile[] currProfiles = null; - SystemCompileManager compileManager = null; + if (subsystem != null) { - if (ssf == null) ssf = subsystem.getSubSystemConfiguration(); - if (currSystemProfile == null) currSystemProfile = subsystem.getSystemProfile(); + if (subsystemFactory == null) subsystemFactory = subsystem.getSubSystemConfiguration(); + if (profile == null) profile = subsystem.getSystemProfile(); } - if (ssf != null) { - - ISubSystemConfiguration ssc = subsystem.getSubSystemConfiguration(); - - - + + if (null == compileManager) + { if (inputObject instanceof IAdaptable) { ISystemCompileManagerAdapter adapter = (ISystemCompileManagerAdapter)((IAdaptable)inputObject).getAdapter(ISystemCompileManagerAdapter.class); if (null != adapter) { - compileManager = adapter.getSystemCompileManager(ssc); + compileManager = adapter.getSystemCompileManager(subsystemFactory); } } + } - if (null != compileManager) - { - if (currSystemProfile != null) + if (null == compileManager) + { + compileManager = new UniversalCompileManager(); + compileManager.setSubSystemFactory(subsystemFactory); + } + + if (null != compileManager) + { + if (profile != null) { - currProfile = compileManager.getCompileProfile(currSystemProfile); + currProfile = compileManager.getCompileProfile(profile); currProfiles = compileManager.getAllCompileProfiles(); } - caseSensitive = ssf.isCaseSensitive(); + caseSensitive = subsystemFactory.isCaseSensitive(); SystemWorkWithCompileCommandsDialog dlg = new SystemWorkWithCompileCommandsDialog(shell, compileManager, currProfile); /* FIXME - currProfiles cannot be null since above stuff was commented out @@ -155,7 +184,6 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction dlg.setSupportsAddSrcTypeButton(false); } return dlg; - } } return null; } diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemDynamicUserActionMenu.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemDynamicUserActionMenu.java index cb66ce9a4c6..7549fb5bd8b 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemDynamicUserActionMenu.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/useractions/ui/uda/SystemDynamicUserActionMenu.java @@ -21,6 +21,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.files.uda.UDActionSubsystemUniversalFiles; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionSubsystem; import org.eclipse.rse.internal.useractions.ui.uda.actions.SystemWorkWithUDAsAction; @@ -81,6 +82,13 @@ public class SystemDynamicUserActionMenu extends CompoundContributionItem } } + if (null == systemUDActionSubsystem) + { + systemUDActionSubsystem = new UDActionSubsystemUniversalFiles(); + systemUDActionSubsystem.setSubSystemFactory(ssc); + systemUDActionSubsystem.setSubsystem(subsystem); + } + Shell shell = SystemBasePlugin.getActiveWorkbenchShell(); for (int idx = 0; idx < activeProfiles.length; idx++) {