diff --git a/rse/plugins/org.eclipse.rse.useractions/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.useractions/META-INF/MANIFEST.MF index 5ed489c4239..40075f9bcaa 100644 --- a/rse/plugins/org.eclipse.rse.useractions/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.useractions/META-INF/MANIFEST.MF @@ -30,8 +30,6 @@ Export-Package: org.eclipse.rse.useractions.ui.compile, org.eclipse.rse.internal.useractions.files.uda, org.eclipse.rse.internal.useractions.ui, org.eclipse.rse.internal.useractions.ui.compile, - org.eclipse.rse.internal.useractions.ui.compile.teamview, - org.eclipse.rse.internal.useractions.ui.propertypages, org.eclipse.rse.internal.useractions.ui.uda, org.eclipse.rse.internal.useractions.ui.uda.actions, org.eclipse.rse.internal.useractions.ui.uda.util diff --git a/rse/plugins/org.eclipse.rse.useractions/plugin.xml b/rse/plugins/org.eclipse.rse.useractions/plugin.xml index 238b8d84381..162f5d7a38f 100644 --- a/rse/plugins/org.eclipse.rse.useractions/plugin.xml +++ b/rse/plugins/org.eclipse.rse.useractions/plugin.xml @@ -2,42 +2,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileProfile.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileProfile.java index b987d064e88..670515a5b83 100644 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileProfile.java +++ b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileProfile.java @@ -10,16 +10,14 @@ * Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemCompileXMLConstants * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Xuan Chen (IBM) - [222263] Need to provide a PropertySet Adapter for System Team View (cleanup some use action stuff) + * Xuan Chen (IBM) - [225617] [useraction][api] Remove Team view support inside user action. *******************************************************************************/ package org.eclipse.rse.internal.useractions.ui.compile; -import java.io.File; import java.util.Vector; -import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; -import org.eclipse.core.runtime.IPath; import org.eclipse.jface.viewers.Viewer; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.model.IProperty; diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileCommandAdapter.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileCommandAdapter.java deleted file mode 100644 index 47d023e6c16..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileCommandAdapter.java +++ /dev/null @@ -1,210 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2008 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 - * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation - * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API - * David McKnight (IBM) - [216252] [nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible - *******************************************************************************/ - -package org.eclipse.rse.internal.useractions.ui.compile.teamview; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.rse.internal.useractions.UserActionsResources; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommand; -import org.eclipse.rse.ui.SystemMenuManager; -import org.eclipse.rse.ui.view.AbstractSystemViewAdapter; -import org.eclipse.rse.ui.view.ISystemPropertyConstants; -import org.eclipse.rse.ui.view.ISystemViewElementAdapter; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -/** - * Adapter for displaying and processing SystemTeamViewCompileCommandNode objects in tree views, such as - * the Team view. - */ -public class SystemTeamViewCompileCommandAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter { - private boolean actionsCreated = false; - //private SystemWorkWithUDAsAction wwActionsAction; - // ------------------- - // property descriptors - // ------------------- - private static PropertyDescriptor[] propertyDescriptorArray = null; - - /** - * Returns any actions that should be contributed to the popup menu - * for the given element. - * @param menu The menu to contribute actions to - * @param selection The window's current selection. - * @param shell Shell of viewer - * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first. - */ - public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup) { - if (!actionsCreated) createActions(); - //wwActionsAction.setShell(shell); - //if (categoryType.equals(SystemTeamViewCategoryNode.MEMENTO_USERACTIONS) && ssfNode.getSubSystemFactory().supportsUserDefinedActions()) - // menu.add(menuGroup, wwActionsAction); - } - - private void createActions() { - actionsCreated = true; - //wwActionsAction = new SystemWorkWithUDAsAction(null); - } - - /** - * Returns an image descriptor for the image. More efficient than getting the image. - * @param element The element for which an image is desired - */ - public ImageDescriptor getImageDescriptor(Object element) { - return ((SystemTeamViewCompileCommandNode) element).getImageDescriptor(); - } - - /** - * Return the label for this object - */ - public String getText(Object element) { - return ((SystemTeamViewCompileCommandNode) element).getLabel(); - } - - /** - * Return the name of this object, which may be different than the display text ({#link #getText(Object)}. - *

- * Called by common rename and delete actions. - */ - public String getName(Object element) { - return ((SystemTeamViewCompileCommandNode) element).getLabel(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier#getAbsoluteName(java.lang.Object) - */ - public String getAbsoluteName(Object element) { - SystemTeamViewCompileCommandNode cmd = (SystemTeamViewCompileCommandNode) element; - return cmd.getParentCompileType().getLabel() + "." + getLabel(element); //$NON-NLS-1$ - } - - /** - * Return the type label for this object - */ - public String getType(Object element) { - return UserActionsResources.RESID_PROPERTY_TEAM_COMPILECMD_TYPE_VALUE; - } - - /** - * Return the string to display in the status line when the given object is selected. - */ - public String getStatusLineText(Object element) { - SystemTeamViewCompileCommandNode cmd = (SystemTeamViewCompileCommandNode) element; - return UserActionsResources.RESID_PROPERTY_TEAM_COMPILECMD_TYPE_VALUE + ": " + cmd.getLabel(); //$NON-NLS-1$ - } - - /** - * Return the parent of this object. We return the RemoteSystemsConnections project - */ - public Object getParent(Object element) { - SystemTeamViewCompileCommandNode cmd = (SystemTeamViewCompileCommandNode) element; - return cmd.getParentCompileType(); - } - - /** - * Return the children of this profile. - */ - public Object[] getChildren(IAdaptable element, IProgressMonitor mon) { - //SystemTeamViewCompileCommandNode cmd = (SystemTeamViewCompileCommandNode)element; - return null; - } - - /** - * Return true if this profile has children. We return true. - */ - public boolean hasChildren(IAdaptable element) { - return false; - } - - // Property sheet descriptors defining all the properties we expose in the Property Sheet - /** - * Return our unique property descriptors, which getPropertyDescriptors adds to the common properties. - */ - protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors() { - if (propertyDescriptorArray == null) { - propertyDescriptorArray = new PropertyDescriptor[2]; - int idx = 0; - // origin - propertyDescriptorArray[idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_ORIGIN,UserActionsResources.RESID_PROPERTY_ORIGIN_LABEL, - UserActionsResources.RESID_PROPERTY_ORIGIN_TOOLTIP); - // command - propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_COMMAND, UserActionsResources.RESID_PROPERTY_COMMAND_LABEL, - UserActionsResources.RESID_PROPERTY_COMMAND_TOOLTIP); - } - return propertyDescriptorArray; - } - - /** - * Returns the current value for the named property. - * The parent handles P_TEXT and P_TYPE only, and we augment that here. - * @param key - the name of the property as named by its property descriptor - * @return the current value of the property - */ - public Object internalGetPropertyValue(Object key) { - String name = (String) key; - SystemTeamViewCompileCommandNode cmdNode = (SystemTeamViewCompileCommandNode) propertySourceInput; - SystemCompileCommand cmd = cmdNode.getCompileCommand(); - if (name.equals(ISystemPropertyConstants.P_ORIGIN)) { - if (cmd.isIBMSupplied()) { - if (!cmd.getCurrentString().equals(cmd.getDefaultString())) - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBMUSER_VALUE; - else - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBM_VALUE; - } else if (cmd.isISVSupplied()) { - if (!cmd.getCurrentString().equals(cmd.getDefaultString())) - return UserActionsResources.RESID_PROPERTY_ORIGIN_ISVUSER_VALUE; - else - return UserActionsResources.RESID_PROPERTY_ORIGIN_ISV_VALUE; - } else - return UserActionsResources.RESID_PROPERTY_ORIGIN_USER_VALUE; - } else if (name.equals(ISystemPropertyConstants.P_COMMAND)) { - return cmd.getCurrentString(); - } else - return null; - } - // ------------------------------------------------------------ - // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER... - // ------------------------------------------------------------ - //we currently don't support re-expanding past the profile level, for performance reasons: - // we don't want to bring all subsystems to life to restore expansion state. - /* - * Return what to save to disk to identify this element in the persisted list of expanded elements. - * - public String getMementoHandle(Object element) - { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode)element; - return type.getMementoHandle(); - }*/ - /* - * Return a short string to uniquely identify the type of resource. - * - public String getMementoHandleKey(Object element) - { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode)element; - return type.getProfile().getName() + "." + type.getParentCategory().getLabel() +"." + type.getParentSubSystemFactory().getName() + "." + type.getLabel(); - }*/ - - /** - * This is a local RSE artifact so returning false - * - * @param element the object to check - * @return false since this is not remote - */ - public boolean isRemote(Object element) { - return false; - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileCommandNode.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileCommandNode.java deleted file mode 100644 index 32f76132458..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileCommandNode.java +++ /dev/null @@ -1,107 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2007 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 - * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands - * API to the user actions plugin - *******************************************************************************/ -package org.eclipse.rse.internal.useractions.ui.compile.teamview; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.internal.useractions.IUserActionsImageIds; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommand; -import org.eclipse.rse.ui.RSEUIPlugin; - -/** - * This class represents a compile command node in the Team view. - */ -public class SystemTeamViewCompileCommandNode implements IAdaptable { - //private String mementoHandle; - private SystemCompileCommand command; - private SystemTeamViewCompileTypeNode parentType; - - /** - * Constructor - */ - public SystemTeamViewCompileCommandNode(SystemTeamViewCompileTypeNode parentType, SystemCompileCommand command) { - super(); - this.command = command; - this.parentType = parentType; - } - - /** - * This is the method required by the IAdaptable interface. - * Given an adapter class type, return an object castable to the type, or - * null if this is not possible. - */ - public Object getAdapter(Class adapterType) { - return Platform.getAdapterManager().getAdapter(this, adapterType); - } - - /** - * Return this node's image - * @return the image to show in the tree, for this node - */ - public ImageDescriptor getImageDescriptor() { - return RSEUIPlugin.getDefault().getImageDescriptor(IUserActionsImageIds.COMPILE_1); - } - - /** - * Return this node's label - * @return the translated label to show in the tree, for this node - */ - public String getLabel() { - return command.getLabel(); - } - - /** - * @return profile this category is associated with - */ - public ISystemProfile getProfile() { - return parentType.getProfile(); - } - - /* - * @return the untranslated value to store in the memento, to uniquely identify this node - * - public String getMementoHandle() - { - return mementoHandle; - }*/ - /* - * Set the untranslated value to store in the memento, to uniquely identify this node - * @param string - untranslated value - * - public void setMementoHandle(String string) - { - mementoHandle = string; - }*/ - /** - * Return the compile command this node represents - */ - public SystemCompileCommand getCompileCommand() { - return command; - } - - /** - * Set the compile command this node represents - */ - public void setCompileCommand(SystemCompileCommand command) { - this.command = command; - } - - /** - * Return the parent compile type this is a child of. - */ - public SystemTeamViewCompileTypeNode getParentCompileType() { - return parentType; - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileTypeAdapter.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileTypeAdapter.java deleted file mode 100644 index 92c7990047b..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileTypeAdapter.java +++ /dev/null @@ -1,201 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2008 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 - * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation - * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API - *******************************************************************************/ - -package org.eclipse.rse.internal.useractions.ui.compile.teamview; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.internal.useractions.UserActionsResources; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommand; -import org.eclipse.rse.ui.SystemMenuManager; -import org.eclipse.rse.ui.view.AbstractSystemViewAdapter; -import org.eclipse.rse.ui.view.ISystemPropertyConstants; -import org.eclipse.rse.ui.view.ISystemViewElementAdapter; -import org.eclipse.rse.useractions.ui.compile.SystemWorkWithCompileCommandsAction; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -/** - * Adapter for displaying and processing SystemTeamViewCompileTypeNode objects in tree views, such as - * the Team view. - */ -public class SystemTeamViewCompileTypeAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter { - private boolean actionsCreated = false; - private SystemWorkWithCompileCommandsAction wwCmdsAction; - // ------------------- - // property descriptors - // ------------------- - private static PropertyDescriptor[] propertyDescriptorArray = null; - - /** - * Returns any actions that should be contributed to the popup menu - * for the given element. - * @param menu The menu to contribute actions to - * @param selection The window's current selection. - * @param shell Shell of viewer - * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first. - */ - public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup) { - if (!actionsCreated) createActions(); - wwCmdsAction.setShell(shell); - menu.add(menuGroup, wwCmdsAction); - } - - private void createActions() { - actionsCreated = true; - wwCmdsAction = new SystemWorkWithCompileCommandsAction(null, true); - } - - /** - * Returns an image descriptor for the image. More efficient than getting the image. - * @param element The element for which an image is desired - */ - public ImageDescriptor getImageDescriptor(Object element) { - return ((SystemTeamViewCompileTypeNode) element).getImageDescriptor(); - } - - /** - * Return the label for this object - */ - public String getText(Object element) { - return ((SystemTeamViewCompileTypeNode) element).getLabel(); - } - - /** - * Return the name of this object, which may be different than the display text ({#link #getText(Object)}. - *

- * Called by common rename and delete actions. - */ - public String getName(Object element) { - return ((SystemTeamViewCompileTypeNode) element).getLabel(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier#getAbsoluteName(java.lang.Object) - */ - public String getAbsoluteName(Object element) { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode) element; - ISystemProfile profile = type.getProfile(); - return profile.getName() + "." + type.getLabel(); //$NON-NLS-1$ - } - - /** - * Return the type label for this object - */ - public String getType(Object element) { - return UserActionsResources.RESID_PROPERTY_TEAM_COMPILETYPE_TYPE_VALUE; - } - - /** - * Return the string to display in the status line when the given object is selected. - */ - public String getStatusLineText(Object element) { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode) element; - return UserActionsResources.RESID_PROPERTY_TEAM_COMPILETYPE_TYPE_VALUE + ": " + type.getLabel(); //$NON-NLS-1$ - } - - /** - * Return the parent of this object. We return the RemoteSystemsConnections project - */ - public Object getParent(Object element) { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode) element; - return type.getParentSubSystemFactory(); - } - - /** - * Return the children of this profile. - */ - public Object[] getChildren(IAdaptable element, IProgressMonitor mon) { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode) element; - SystemCompileCommand[] cmds = type.getCompileType().getCompileCommandsArray(); - SystemTeamViewCompileCommandNode[] nodes = null; - if (cmds != null) { - nodes = new SystemTeamViewCompileCommandNode[cmds.length]; - for (int idx = 0; idx < cmds.length; idx++) - nodes[idx] = new SystemTeamViewCompileCommandNode(type, cmds[idx]); - } - return nodes; - } - - /** - * Return true if this profile has children. We return true. - */ - public boolean hasChildren(IAdaptable element) { - return true; - } - - // Property sheet descriptors defining all the properties we expose in the Property Sheet - /** - * Return our unique property descriptors, which getPropertyDescriptors adds to the common properties. - */ - protected org.eclipse.ui.views.properties.IPropertyDescriptor[] internalGetPropertyDescriptors() { - if (propertyDescriptorArray == null) { - propertyDescriptorArray = new PropertyDescriptor[1]; - int idx = 0; - // file types - propertyDescriptorArray[idx] = new PropertyDescriptor(ISystemPropertyConstants.P_COMPILETYPE_TYPES, UserActionsResources.RESID_PROPERTY_COMPILETYPE_TYPES_LABEL); - propertyDescriptorArray[idx].setDescription(UserActionsResources.RESID_PROPERTY_COMPILETYPE_TYPES_DESCRIPTION); - ++idx; - } - return propertyDescriptorArray; - } - - /** - * Returns the current value for the named property. - * The parent handles P_TEXT and P_TYPE only, and we augment that here. - * @param key - the name of the property as named by its property descriptor - * @return the current value of the property - */ - public Object internalGetPropertyValue(Object key) { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode) propertySourceInput; - if (key.equals(ISystemPropertyConstants.P_COMPILETYPE_TYPES)) { - return type.getCompileType().getType(); - } else - return null; - } - // ------------------------------------------------------------ - // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER... - // ------------------------------------------------------------ - //we currently don't support re-expanding past the profile level, for performance reasons: - // we don't want to bring all subsystems to life to restore expansion state. - /* - * Return what to save to disk to identify this element in the persisted list of expanded elements. - * - public String getMementoHandle(Object element) - { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode)element; - return type.getMementoHandle(); - }*/ - /* - * Return a short string to uniquely identify the type of resource. - * - public String getMementoHandleKey(Object element) - { - SystemTeamViewCompileTypeNode type = (SystemTeamViewCompileTypeNode)element; - return type.getProfile().getName() + "." + type.getParentCategory().getLabel() +"." + type.getParentSubSystemFactory().getName() + "." + type.getLabel(); - }*/ - - /** - * This is a local RSE artifact so returning false - * - * @param element the object to check - * @return false since this is not remote - */ - public boolean isRemote(Object element) { - return false; - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileTypeNode.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileTypeNode.java deleted file mode 100644 index 2eb1f685c45..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewCompileTypeNode.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2007 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 - *******************************************************************************/ -package org.eclipse.rse.internal.useractions.ui.compile.teamview; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.internal.ui.view.team.SystemTeamViewCategoryNode; -import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileType; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.PlatformUI; - -//import com.ibm.etools.systems.subsystems.SubSystemFactory; -/** - * This class represents a compile type node in the Team view. - */ -public class SystemTeamViewCompileTypeNode implements IAdaptable { - //private String mementoHandle; - private SystemCompileType type; - private SystemTeamViewSubSystemConfigurationNode parentSSF; - - /** - * Constructor - */ - public SystemTeamViewCompileTypeNode(SystemTeamViewSubSystemConfigurationNode parentSSF, SystemCompileType type) { - super(); - this.type = type; - this.parentSSF = parentSSF; - } - - /** - * This is the method required by the IAdaptable interface. - * Given an adapter class type, return an object castable to the type, or - * null if this is not possible. - */ - public Object getAdapter(Class adapterType) { - return Platform.getAdapterManager().getAdapter(this, adapterType); - } - - /** - * Compare this node to another. - */ - public boolean equals(Object o) { - if (o instanceof SystemTeamViewCompileTypeNode) { - SystemTeamViewCompileTypeNode other = (SystemTeamViewCompileTypeNode) o; - if ((type == other.getCompileType()) && parentSSF.equals(other.getParentSubSystemFactory())) - return true; - else - return false; - } else - return super.equals(o); - } - - /** - * Return this node's image - * @return the image to show in the tree, for this node - */ - public ImageDescriptor getImageDescriptor() { - //return RSEUIPlugin.getDefault().getImageDescriptor(ISystemConstants.ICON_SYSTEM_FILE_ID); - return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE); // - } - - /** - * Return this node's label - * @return the translated label to show in the tree, for this node - */ - public String getLabel() { - return type.toString(); - } - - /** - * @return profile this category is associated with - */ - public ISystemProfile getProfile() { - return parentSSF.getProfile(); - } - - /* - * @return the untranslated value to store in the memento, to uniquely identify this node - * - public String getMementoHandle() - { - return mementoHandle; - }*/ - /* - * Set the untranslated value to store in the memento, to uniquely identify this node - * @param string - untranslated value - * - public void setMementoHandle(String string) - { - mementoHandle = string; - }*/ - /** - * Return the compile type this node represents - */ - public SystemCompileType getCompileType() { - return type; - } - - /** - * Set the compile type this node represents - */ - public void setCompileType(SystemCompileType type) { - this.type = type; - } - - /** - * Return the grandparent category this is a grandchild of. - */ - public SystemTeamViewCategoryNode getParentCategory() { - return parentSSF.getParentCategory(); - } - - /** - * Return the parent subsystem factory this is a child of. - */ - public SystemTeamViewSubSystemConfigurationNode getParentSubSystemFactory() { - return parentSSF; - } - - /** - * Set the parent subsystem factory this is a child of. - */ - public void setParentSubSystemFactory(SystemTeamViewSubSystemConfigurationNode factory) { - parentSSF = factory; - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewUserActionAdapter.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewUserActionAdapter.java deleted file mode 100644 index ddbcdc5da0c..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/teamview/SystemTeamViewUserActionAdapter.java +++ /dev/null @@ -1,223 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2008 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 - * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation - * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API - * David McKnight (IBM) - [216252] [nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible - *******************************************************************************/ - -package org.eclipse.rse.internal.useractions.ui.compile.teamview; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.rse.internal.useractions.UserActionsIcon; -import org.eclipse.rse.internal.useractions.UserActionsResources; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionElement; -import org.eclipse.rse.ui.SystemMenuManager; -import org.eclipse.rse.ui.view.AbstractSystemViewAdapter; -import org.eclipse.rse.ui.view.ISystemPropertyConstants; -import org.eclipse.rse.ui.view.ISystemViewElementAdapter; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.PropertyDescriptor; - -/** - * Adapter for displaying and processing user action objects in tree views, such as - * the Team view. - */ -public class SystemTeamViewUserActionAdapter extends AbstractSystemViewAdapter implements ISystemViewElementAdapter { - private boolean actionsCreated = false; - // ------------------- - // property descriptors - // ------------------- - private static PropertyDescriptor[] propertyDescriptorArray = null; - - /** - * Returns any actions that should be contributed to the popup menu - * for the given element. - * @param menu The menu to contribute actions to - * @param selection The window's current selection. - * @param shell Shell of viewer - * @param menuGroup recommended menu group to add actions to. If added to another group, you must be sure to create that group first. - */ - public void addActions(SystemMenuManager menu, IStructuredSelection selection, Shell shell, String menuGroup) { - if (!actionsCreated) createActions(); - //menu.add(menuGroup, copyAction); - } - - private void createActions() { - actionsCreated = true; - } - - /** - * Returns an image descriptor for the image. More efficient than getting the image. - * @param element The element for which an image is desired - */ - public ImageDescriptor getImageDescriptor(Object element) { - SystemUDActionElement action = (SystemUDActionElement) element; - //return action.getImage(); - if (action.isIBM()) { - if (action.isUserChanged()) - return UserActionsIcon.USERACTION_IBMUSR.getImageDescriptor(); - else - return UserActionsIcon.USERACTION_IBM.getImageDescriptor(); - } else - return UserActionsIcon.USERACTION_USR.getImageDescriptor(); - } - - /** - * Return the label for this object - */ - public String getText(Object element) { - SystemUDActionElement action = (SystemUDActionElement) element; - return action.getName(); // hmm, should it be getCommand()? - } - - /** - * Return the name of this object, which may be different than the display text ({#link #getText(Object)}. - *

- * Called by common rename and delete actions. - */ - public String getName(Object element) { - SystemUDActionElement action = (SystemUDActionElement) element; - return action.getName(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier#getAbsoluteName(java.lang.Object) - */ - public String getAbsoluteName(Object element) { - SystemUDActionElement action = (SystemUDActionElement) element; - return action.getName(); - } - - /** - * Return the type label for this object - */ - public String getType(Object element) { - return UserActionsResources.RESID_PROPERTY_TEAM_USERACTION_TYPE_VALUE; - } - - /** - * Return the string to display in the status line when the given object is selected. - */ - public String getStatusLineText(Object element) { - SystemUDActionElement action = (SystemUDActionElement) element; - return UserActionsResources.RESID_TEAMVIEW_USERACTION_VALUE + ": " + action.getName(); //$NON-NLS-1$ - } - - /** - * Return the parent of this object. We return the RemoteSystemsConnections project - */ - public Object getParent(Object element) { - SystemUDActionElement action = (SystemUDActionElement) element; - return action.getData(); - } - - /** - * Return the children of this profile. - */ - public Object[] getChildren(IAdaptable element, IProgressMonitor mon) { - //SystemUDActionElement action = (SystemUDActionElement)element; - return null; - } - - /** - * Return true if this profile has children. We return false. - */ - public boolean hasChildren(IAdaptable element) { - return false; - } - - // Property sheet descriptors defining all the properties we expose in the Property Sheet - /** - * Return our unique property descriptors, which getPropertyDescriptors adds to the common properties. - */ - protected IPropertyDescriptor[] internalGetPropertyDescriptors() { - if (propertyDescriptorArray == null) { - propertyDescriptorArray = new PropertyDescriptor[4]; - int idx = 0; - // origin - propertyDescriptorArray[idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_ORIGIN, UserActionsResources.RESID_PROPERTY_ORIGIN_LABEL, - UserActionsResources.RESID_PROPERTY_ORIGIN_TOOLTIP); - // command - propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_COMMAND, UserActionsResources.RESID_PROPERTY_COMMAND_LABEL, - UserActionsResources.RESID_PROPERTY_COMMAND_TOOLTIP); - // comment - propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_COMMENT, UserActionsResources.RESID_PROPERTY_COMMENT_LABEL, - UserActionsResources.RESID_PROPERTY_COMMENT_TOOLTIP); - // domain - propertyDescriptorArray[++idx] = createSimplePropertyDescriptor(ISystemPropertyConstants.P_USERACTION_DOMAIN, UserActionsResources.RESID_PROPERTY_USERACTION_DOMAIN_LABEL, - UserActionsResources.RESID_PROPERTY_USERACTION_DOMAIN_TOOLTIP); - } - return propertyDescriptorArray; - } - - /** - * Returns the current value for the named property. - * The parent handles P_TEXT and P_TYPE only, and we augment that here. - * @param key - the name of the property as named by its property descriptor - * @return the current value of the property - */ - public Object internalGetPropertyValue(Object key) { - String name = (String) key; - SystemUDActionElement action = (SystemUDActionElement) propertySourceInput; - //action.get - if (name.equals(ISystemPropertyConstants.P_ORIGIN)) { - if (action.isIBM()) { - if (action.isUserChanged()) - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBMUSER_VALUE; - else - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBM_VALUE; - } else - return UserActionsResources.RESID_PROPERTY_ORIGIN_USER_VALUE; - } else if (name.equals(ISystemPropertyConstants.P_COMMAND)) { - return action.getCommand(); - } else if (name.equals(ISystemPropertyConstants.P_COMMENT)) { - return action.getComment(); - } else if (name.equals(ISystemPropertyConstants.P_USERACTION_DOMAIN)) { - int domain = action.getDomain(); - if (domain == -1) - return UserActionsResources.RESID_PROPERTY_USERACTION_DOMAIN_ALL_VALUE; - else - return action.getManager().getActionSubSystem().getXlatedDomainNames()[domain]; - } else - return null; - } - - // ------------------------------------------------------------ - // METHODS FOR SAVING AND RESTORING EXPANSION STATE OF VIEWER... - // ------------------------------------------------------------ - /** - * Return what to save to disk to identify this element in the persisted list of expanded elements. - */ - public String getMementoHandle(Object element) { - return null; // not needed now as we don't re-expand to this level - } - - /** - * Return a short string to uniquely identify the type of resource. - */ - public String getMementoHandleKey(Object element) { - return null; // not needed now as we don't re-expand to this level - } - - /** - * This is a local RSE artifact so returning false - * - * @param element the object to check - * @return false since this is not remote - */ - public boolean isRemote(Object element) { - return false; - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewCompileCommandPropertyPage.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewCompileCommandPropertyPage.java deleted file mode 100644 index f576a13f91c..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewCompileCommandPropertyPage.java +++ /dev/null @@ -1,192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2002, 2008 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 - * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core - * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry - * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands - * API to the user actions plugin - *******************************************************************************/ - -package org.eclipse.rse.internal.useractions.ui.propertypages; - -import org.eclipse.rse.core.RSECorePlugin; -import org.eclipse.rse.core.events.ISystemModelChangeEvents; -import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents; -import org.eclipse.rse.internal.useractions.UserActionsResources; -import org.eclipse.rse.internal.useractions.ui.compile.ISystemCompileCommandEditPaneHoster; -import org.eclipse.rse.internal.useractions.ui.compile.ISystemCompileCommandEditPaneListener; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommand; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileCommandEditPane; -import org.eclipse.rse.internal.useractions.ui.compile.SystemCompileManager; -import org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileCommandNode; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; -import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.SystemWidgetHelpers; -import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * The property page for compile command nodes in the Team view. - * This is an output-only page. - */ -public class SystemTeamViewCompileCommandPropertyPage extends SystemBasePropertyPage implements ISystemCompileCommandEditPaneHoster, ISystemCompileCommandEditPaneListener { - protected SystemCompileManager compileManager; - protected SystemCompileCommandEditPane editpane; - protected Label labelType, labelProfile, labelOrigin, ccLabel; - protected Composite composite_prompts; - protected boolean initDone = false; - protected int nbrColumns; - - /** - * Constructor - */ - public SystemTeamViewCompileCommandPropertyPage() { - super(); - } - - /** - * We do want the Apply and the Default buttons - */ - protected boolean wantDefaultAndApplyButton() { - return true; - } - - /** - * Create the page's GUI contents. - * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite) - */ - protected Control createContentArea(Composite parent) { - // Inner composite - nbrColumns = 2; - composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns); - // Type prompt - String typeLabel = SystemUDAResources.RESID_PP_PROPERTIES_TYPE_LABEL; - String typeTooltip = SystemUDAResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP; - labelType = SystemWidgetHelpers.createLabeledLabel(composite_prompts, typeLabel, typeTooltip, false); - labelType.setText(UserActionsResources.RESID_PP_COMPILECMD_TYPE_VALUE); - // Profile prompt - String profileLabel = UserActionsResources.RESID_PP_COMPILECMD_PROFILE_LABEL; - String profileTooltip = UserActionsResources.RESID_PP_COMPILECMD_PROFILE_TOOLTIP; - labelProfile = createLabeledLabel(composite_prompts, profileLabel, profileTooltip); - // Source Type prompt - String origPromptLabel = UserActionsResources.RESID_PP_COMPILECMD_ORIGIN_LABEL; - String origPromptTooltip = UserActionsResources.RESID_PP_COMPILECMD_ORIGIN_TOOLTIP; - labelOrigin = createLabeledLabel(composite_prompts, origPromptLabel, origPromptTooltip); - // now add a top spacer line and visual separator line, for the edit pane - addFillerLine(composite_prompts, nbrColumns); - ccLabel = SystemWidgetHelpers.createLabel(composite_prompts, ""); //$NON-NLS-1$ - ((GridData) ccLabel.getLayoutData()).horizontalSpan = nbrColumns; - addSeparatorLine(composite_prompts, nbrColumns); - if (!initDone) doInitializeFields(); - return composite_prompts; - } - - /** - * From parent: do full page validation - */ - protected boolean verifyPageContents() { - return true; - } - - /** - * Get the input node - */ - protected SystemTeamViewCompileCommandNode getCompileCommand() { - Object element = getElement(); - return ((SystemTeamViewCompileCommandNode) element); - } - - /** - * Initialize values of input fields based on input - */ - protected void doInitializeFields() { - initDone = true; - SystemTeamViewCompileCommandNode cmd = getCompileCommand(); - // populate GUI... - labelProfile.setText(cmd.getProfile().getName()); - labelOrigin.setText(getOrigin(cmd.getCompileCommand())); - // edit pane - compileManager = cmd.getCompileCommand().getParentType().getParentProfile().getParentManager(); - ISubSystemConfiguration ssf = compileManager.getSubSystemFactory(); - boolean caseSensitive = true; - if (ssf != null) caseSensitive = ssf.isCaseSensitive(); - editpane = compileManager.getCompileCommandEditPane(getShell(), this, caseSensitive); - Control editpaneComposite = editpane.createContents(composite_prompts); - ((GridData) editpaneComposite.getLayoutData()).horizontalSpan = nbrColumns; - editpane.addChangeListener(this); - editpane.isComplete();// side effect is initial enablement of test button - editpane.setCompileCommand(cmd.getCompileCommand().getParentType(), cmd.getCompileCommand()); - editpane.configureHeadingLabel(ccLabel); // sets the heading for edit mode - } - - /** - * Get xlated origin value - */ - private String getOrigin(SystemCompileCommand cmd) { - if (cmd.isIBMSupplied()) { - if (!cmd.getCurrentString().equals(cmd.getDefaultString())) - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBMUSER_VALUE; - else - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBM_VALUE; - } else if (cmd.isISVSupplied()) { - if (!cmd.getCurrentString().equals(cmd.getDefaultString())) - return UserActionsResources.RESID_PROPERTY_ORIGIN_ISVUSER_VALUE; - else - return UserActionsResources.RESID_PROPERTY_ORIGIN_ISV_VALUE; - } else - return UserActionsResources.RESID_PROPERTY_ORIGIN_USER_VALUE; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.compile.ISystemCompileCommandEditPaneListener#compileCommandChanged(com.ibm.etools.systems.core.ui.messages.SystemMessage) - */ - public void compileCommandChanged(SystemMessage message) { - if (message == null) - clearErrorMessage(); - else - setErrorMessage(message); - } - - /** - * Intercept of parent. - * Called when user presses OK. - */ - public boolean performOk() { - boolean ok = super.performOk(); - if (!ok || (editpane.verify() != null)) // verify will call back to compileCommandChanged - return false; - SystemCompileCommand editedCompileCmd = editpane.saveChanges(); - ok = (editedCompileCmd != null); - if (!ok) return false; - getCompileCommand().getCompileCommand().getParentType().getParentProfile().writeToDisk(); - RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, editedCompileCmd, null); - return ok; - } - - /** - * Called by parent when user presses Default button - */ - public void performDefaults() { - editpane.clearErrorMessage(); - SystemTeamViewCompileCommandNode cmd = getCompileCommand(); - editpane.setCompileCommand(cmd.getCompileCommand().getParentType(), cmd.getCompileCommand()); - clearErrorMessage(); - } - - /** - * Called by parent when user presses OK button - */ - public boolean performCancel() { - return super.performCancel(); - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewCompileTypePropertyPage.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewCompileTypePropertyPage.java deleted file mode 100644 index ad1576ec3c6..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewCompileTypePropertyPage.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.eclipse.rse.internal.useractions.ui.propertypages; - -/******************************************************************************* - * Copyright (c) 2002, 2008 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 - *******************************************************************************/ -import org.eclipse.rse.internal.useractions.UserActionsResources; -import org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileTypeNode; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; -import org.eclipse.rse.ui.SystemWidgetHelpers; -import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; - -/** - * The property page for compile type nodes in the Team view. - * This is an output-only page. - */ -public class SystemTeamViewCompileTypePropertyPage extends SystemBasePropertyPage { - protected Label labelType, labelProfile, labelFileType; - protected String errorMessage; - protected boolean initDone = false; - - /** - * Constructor - */ - public SystemTeamViewCompileTypePropertyPage() { - super(); - } - - /** - * Create the page's GUI contents. - * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite) - */ - protected Control createContentArea(Composite parent) { - // Inner composite - Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, 2); - // Type prompt - String typeLabel = SystemUDAResources.RESID_PP_PROPERTIES_TYPE_LABEL; - String typeTooltip = SystemUDAResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP; - labelType = createLabeledLabel(composite_prompts, typeLabel, typeTooltip); - labelType.setText(UserActionsResources.RESID_PP_COMPILETYPE_TYPE_VALUE); - // Profile prompt - String profileLabel = UserActionsResources.RESID_PP_COMPILETYPE_PROFILE_LABEL; - String profileTooltip = UserActionsResources.RESID_PP_COMPILETYPE_PROFILE_TOOLTIP; - labelProfile = createLabeledLabel(composite_prompts, profileLabel, profileTooltip); - // Source Type prompt - String fileTypeLabel = UserActionsResources.RESID_PP_COMPILETYPE_FILETYPE_LABEL; - String fileTypeTooltip = UserActionsResources.RESID_PP_COMPILETYPE_FILETYPE_TOOLTIP; - labelFileType = createLabeledLabel(composite_prompts, fileTypeLabel, fileTypeTooltip); - if (!initDone) doInitializeFields(); - return composite_prompts; - } - - /** - * From parent: do full page validation - */ - protected boolean verifyPageContents() { - return true; - } - - /** - * Get the input node - */ - protected SystemTeamViewCompileTypeNode getCompileType() { - Object element = getElement(); - return ((SystemTeamViewCompileTypeNode) element); - } - - /** - * Initialize values of input fields based on input - */ - protected void doInitializeFields() { - initDone = true; - SystemTeamViewCompileTypeNode type = getCompileType(); - // populate GUI... - labelProfile.setText(type.getProfile().getName()); - labelFileType.setText(type.getCompileType().getType()); - } -} diff --git a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewUserActionPropertyPage.java b/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewUserActionPropertyPage.java deleted file mode 100644 index c3b19b2962c..00000000000 --- a/rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/propertypages/SystemTeamViewUserActionPropertyPage.java +++ /dev/null @@ -1,313 +0,0 @@ -package org.eclipse.rse.internal.useractions.ui.propertypages; - -/******************************************************************************* - * Copyright (c) 2002, 2008 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 - *******************************************************************************/ -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.rse.core.model.ISystemProfile; -import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; -import org.eclipse.rse.internal.useractions.UserActionsResources; -import org.eclipse.rse.internal.useractions.ui.uda.ISystemUDAEditPaneHoster; -import org.eclipse.rse.internal.useractions.ui.uda.ISystemUDTreeView; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionEditPane; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionElement; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionSubsystem; -import org.eclipse.rse.internal.useractions.ui.uda.SystemUDBaseManager; -import org.eclipse.rse.internal.useractions.ui.uda.SystemXMLElementWrapper; -import org.eclipse.rse.ui.SystemWidgetHelpers; -import org.eclipse.rse.ui.propertypages.SystemBasePropertyPage; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.TreeItem; - -/** - * The property page for user action nodes in the Team view. - * This is an output-only page. - */ -public class SystemTeamViewUserActionPropertyPage extends SystemBasePropertyPage implements ISystemUDAEditPaneHoster, ISystemUDTreeView { - protected SystemUDActionEditPane editpane; - protected Composite composite_prompts; - protected Label labelType, labelProfile, labelOrigin, labelDomain; - protected String errorMessage; - protected boolean initDone = false; - - /** - * Constructor - */ - public SystemTeamViewUserActionPropertyPage() { - super(); - } - - /** - * We do want the Apply and the Default buttons - */ - protected boolean wantDefaultAndApplyButton() { - return true; - } - - /** - * Create the page's GUI contents. - * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite) - */ - protected Control createContentArea(Composite parent) { - // Inner composite - composite_prompts = SystemWidgetHelpers.createComposite(parent, 2); - // Type prompt - labelType = createLabeledLabel(composite_prompts, SystemUDAResources.RESID_PP_PROPERTIES_TYPE_LABEL, SystemUDAResources.RESID_PP_PROPERTIES_TYPE_TOOLTIP); - labelType.setText(UserActionsResources.RESID_PP_USERACTION_TYPE_VALUE); - // Profile prompt - labelProfile = createLabeledLabel(composite_prompts, UserActionsResources.RESID_PP_USERACTION_PROFILE_LABEL, UserActionsResources.RESID_PP_USERACTION_PROFILE_TOOLTIP); - // Origin prompt - labelOrigin = createLabeledLabel(composite_prompts, UserActionsResources.RESID_PP_USERACTION_ORIGIN_LABEL, UserActionsResources.RESID_PP_USERACTION_ORIGIN_TOOLTIP); - if (!initDone) doInitializeFields(); - return composite_prompts; - } - - /** - * From parent: do full page validation - */ - protected boolean verifyPageContents() { - return true; - } - - /** - * Get the input node - */ - protected SystemUDActionElement getAction() { - Object element = getElement(); - return ((SystemUDActionElement) element); - } - - /** - * Return the user defined action subsystem - */ - protected SystemUDActionSubsystem getUDActionSubsystem(SystemUDActionElement action) { - return action.getManager().getActionSubSystem(); - } - - /** - * Initialize values of input fields based on input - */ - protected void doInitializeFields() { - initDone = true; - SystemUDActionElement action = getAction(); - // populate GUI... - labelProfile.setText(action.getProfile().getName()); - labelOrigin.setText(getOrigin(action)); - // Domain prompt - if (action.getDomain() != -1) { - labelDomain = createLabeledLabel(composite_prompts, UserActionsResources.RESID_PP_USERACTION_DOMAIN_LABEL, UserActionsResources.RESID_PP_USERACTION_DOMAIN_TOOLTIP); - String[] domainNames = action.getManager().getActionSubSystem().getXlatedDomainNames(); - labelDomain.setText(domainNames[action.getDomain()]); - } - addSeparatorLine(composite_prompts, 2); - // add edit pane... - ISubSystemConfiguration ssf = getUDActionSubsystem(action).getSubSystemFactory(); - ISystemProfile profile = action.getProfile(); - editpane = getUDActionSubsystem(action).getCustomUDActionEditPane(null, ssf, profile, this, this); - //System.out.println("UDActionSubsystem is of type: "+getUDActionSubsystem(action).getClass().getName()); - //System.out.println("EditPane is of type: "+editpane.getClass().getName()); - Control c = editpane.createContents(composite_prompts); - ((GridData) c.getLayoutData()).horizontalSpan = 2; - editpane.setAction(action); - } - - /** - * Return xlated string stating where the origin of the given user action is from: - */ - private String getOrigin(SystemUDActionElement action) { - if (action.isIBM()) { - if (action.isUserChanged()) - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBMUSER_VALUE; - else - return UserActionsResources.RESID_PROPERTY_ORIGIN_IBM_VALUE; - } else - return UserActionsResources.RESID_PROPERTY_ORIGIN_USER_VALUE; - } - - /** - * Called by parent when user presses OK or Apply - */ - public boolean performOk() { - boolean ok = super.performOk(); - if (!ok) return false; - editpane.applyPressed(); - return ok; - } - - /** - * Called by parent when user presses Default button - */ - public void performDefaults() { - editpane.revertPressed(); - } - - /** - * Called by parent when user presses OK button - */ - public boolean performCancel() { - return super.performCancel(); - } - - /** - * Identify that the page/dialog is complete - */ - public void setPageComplete(boolean complete) { - setValid(complete); - } - - /** - * Set the help for the given control - */ - public void setHelp(Control c, String id) { - SystemWidgetHelpers.setHelp(c, id); - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#expandDomainNodes() - */ - public void expandDomainNodes() { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#expandDomainNode(java.lang.String) - */ - public void expandDomainNode(String displayName) { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getDocumentManager() - */ - public SystemUDBaseManager getDocumentManager() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedElementName() - */ - public String getSelectedElementName() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedElementDomain() - */ - public int getSelectedElementDomain() { - // TODO Auto-generated method stub - return 0; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#isElementAllSelected() - */ - public boolean isElementAllSelected() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedElement() - */ - public SystemXMLElementWrapper getSelectedElement() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#selectElement(com.ibm.etools.systems.core.ui.uda.SystemXMLElementWrapper) - */ - public void selectElement(SystemXMLElementWrapper element) { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#findParentItem(com.ibm.etools.systems.core.ui.uda.SystemXMLElementWrapper) - */ - public TreeItem findParentItem(SystemXMLElementWrapper element) { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#refreshElementParent(com.ibm.etools.systems.core.ui.uda.SystemXMLElementWrapper) - */ - public void refreshElementParent(SystemXMLElementWrapper element) { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedTreeItem() - */ - public TreeItem getSelectedTreeItem() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedPreviousTreeItem() - */ - public TreeItem getSelectedPreviousTreeItem() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedNextTreeItem() - */ - public TreeItem getSelectedNextTreeItem() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getSelectedNextNextTreeItem() - */ - public TreeItem getSelectedNextNextTreeItem() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#isSelectionVendorSupplied() - */ - public boolean isSelectionVendorSupplied() { - // TODO Auto-generated method stub - return false; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#getVendorOfSelection() - */ - public String getVendorOfSelection() { - // TODO Auto-generated method stub - return null; - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#setSelection(org.eclipse.jface.viewers.ISelection) - */ - public void setSelection(ISelection selection) { - // TODO Auto-generated method stub - } - - /* (non-Javadoc) - * @see com.ibm.etools.systems.core.ui.uda.ISystemUDTreeView#refresh(java.lang.Object) - */ - public void refresh(Object element) { - // TODO Auto-generated method stub - } -} 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 91e6947dbc4..954db0d1eb2 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 @@ -10,6 +10,7 @@ * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands * 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; @@ -19,15 +20,12 @@ import org.eclipse.jface.viewers.IStructuredSelection; 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.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; @@ -89,17 +87,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction * Our opportunity to verify we are allowed for this selected type. */ public boolean updateSelection(IStructuredSelection selection) { - boolean enable = true; - Object inputObject = selection.getFirstElement(); - if (inputObject instanceof SystemTeamViewCompileTypeNode) { - SystemTeamViewCompileTypeNode typeNode = ((SystemTeamViewCompileTypeNode) inputObject); - ISystemProfile currSystemProfile = typeNode.getProfile(); - enable = currSystemProfile.isActive(); - } else if (inputObject instanceof SystemTeamViewSubSystemConfigurationNode) { - ISystemProfile currSystemProfile = ((SystemTeamViewSubSystemConfigurationNode) inputObject).getProfile(); - enable = currSystemProfile.isActive(); - } - return enable; + return true; } /** @@ -178,11 +166,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction */ dlg.setProfiles(currProfiles); dlg.setCaseSensitive(caseSensitive); - if (inputObject instanceof SystemTeamViewCompileTypeNode) { - SystemTeamViewCompileTypeNode node = (SystemTeamViewCompileTypeNode) inputObject; - dlg.setCompileType(node.getCompileType()); - dlg.setSupportsAddSrcTypeButton(false); - } + return dlg; } return null;