### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.ui Index: UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java =================================================================== RCS file: UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java diff -N UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java --- UI/org/eclipse/rse/ui/validators/ValidatorUserTypeTypes.java 25 Aug 2006 11:45:34 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,120 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2002, 2006 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 - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Initial Contributors: - * The following IBM employees contributed to the Remote System Explorer - * component that contains this file: David McKnight, Kushal Munir, - * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, - * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. - * - * Contributors: - * {Name} (company) - description of contribution. - ********************************************************************************/ - -package org.eclipse.rse.ui.validators; -import org.eclipse.rse.services.clientserver.messages.SystemMessage; -import org.eclipse.rse.ui.ISystemMessages; -import org.eclipse.rse.ui.RSEUIPlugin; - - -/** - * This class is used to verify a user defined action's comment - */ -public class ValidatorUserTypeTypes - implements ISystemValidator -{ - public static final int MAX_UDTTYPES_LENGTH = 512; - - protected SystemMessage emptyMsg, invalidMsg, currentMessage; - - /** - * Constructor to use when wanting to specify the "value required" error message, - * but use the default for the "Value not valid" error message - */ - public ValidatorUserTypeTypes() - { - setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_EMPTY), - RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_NOTVALID)); - } - - /** - * Set the error messages, overriding the defaults - */ - public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg) - { - this.emptyMsg = emptyMsg; - this.invalidMsg = invalidMsg; - } - - // --------------------------- - // ISystemValidator methods... - // --------------------------- - - /** - * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object) - */ - public String isValid(Object input) - { - currentMessage = null; - if (!(input instanceof String)) - { - return null; - } - else - return isValid((String)input); - } - /** - * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String) - * @see #getSystemMessage() - */ - public String isValid(String input) - { - currentMessage = null; - if ((input==null)||(input.length()==0)) - { - currentMessage = emptyMsg; - } - else - { - if (input.length() > MAX_UDTTYPES_LENGTH) - currentMessage = invalidMsg; - } - return (currentMessage==null) ? null : currentMessage.getLevelOneText(); - } - - /** - * When isValid returns non-null, call this to get the SystemMessage object for the error - * versus the simple string message. - */ - public SystemMessage getSystemMessage() - { - return currentMessage; - } - - /** - * Return the max length for comments - */ - public int getMaximumNameLength() - { - return MAX_UDTTYPES_LENGTH; - } - - /** - * For convenience, this is a shortcut to calling: - *
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- *
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-}
\ No newline at end of file
Index: UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java
===================================================================
RCS file: UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java
diff -N UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java
--- UI/org/eclipse/rse/ui/validators/ValidatorUserTypeName.java 5 Dec 2006 00:20:13 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,106 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 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
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined type's name.
- */
-public class ValidatorUserTypeName extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_UDTNAME_LENGTH = 50; // max name for a file type
-
- protected SystemMessage msg_Invalid;
-
- /**
- * Use this constructor when the name need not be unique, and you just want the syntax checking.
- */
- public ValidatorUserTypeName()
- {
- super(new String[0], CASE_INSENSITIVE);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_NOTUNIQUE));
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_NOTVALID);
- }
-
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return true;
- }
-
- public String toString()
- {
- return "UserTypeNameValidator class"; //$NON-NLS-1$
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for folder names: 50
- */
- public int getMaximumNameLength()
- {
- return MAX_UDTNAME_LENGTH;
- }
-
-
-}
\ No newline at end of file
Index: UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java
===================================================================
RCS file: UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java
diff -N UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java
--- UI/org/eclipse/rse/ui/validators/ValidatorUserActionCommand.java 25 Aug 2006 11:45:34 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 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
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's command
- */
-public class ValidatorUserActionCommand
- implements ISystemValidator
-{
- public static final int MAX_UDACMD_LENGTH = 512; // max command for an action
-
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- */
- public ValidatorUserActionCommand()
- {
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMD_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMD_NOTVALID));
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- currentMessage = emptyMsg;
- }
- else
- {
- if (input.length() > MAX_UDACMD_LENGTH)
- currentMessage = invalidMsg;
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for comments
- */
- public int getMaximumNameLength()
- {
- return MAX_UDACMD_LENGTH;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- *
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- *
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-}
\ No newline at end of file
Index: UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java
===================================================================
RCS file: UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java
diff -N UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java
--- UI/org/eclipse/rse/ui/validators/ValidatorCompileCommandLabel.java 30 May 2007 15:53:22 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,132 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 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
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Collection;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined compile command's label
- */
-public class ValidatorCompileCommandLabel extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_CMDLABEL_LENGTH = 50; // max name for a compile command name
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * Use this constructor when you have a list of existing labels.
- * The collection will not be modified by the validator.
- */
- public ValidatorCompileCommandLabel(Collection existingLabelList)
- {
- super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
- init();
- }
- /**
- * Use this constructor when you have an array of existing labels.
- */
- public ValidatorCompileCommandLabel(String existingLabelList[])
- {
- super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
- init();
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking. Or if you will call setExistingNamesList later.
- */
- public ValidatorCompileCommandLabel()
- {
- super(new String[0], CASE_INSENSITIVE);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character.
- (newText.indexOf('@') == -1)); // defect 43950
- }
-
- public String toString()
- {
- return getClass().getName();
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for compile commands: 50
- */
- public int getMaximumNameLength()
- {
- return MAX_CMDLABEL_LENGTH;
- }
-
-
-}
\ No newline at end of file
Index: UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java
===================================================================
RCS file: UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java
diff -N UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java
--- UI/org/eclipse/rse/ui/validators/ValidatorUserActionComment.java 25 Aug 2006 11:45:34 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,120 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 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
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's comment
- */
-public class ValidatorUserActionComment
- implements ISystemValidator
-{
- public static final int MAX_UDACMT_LENGTH = 256; // max comment for an action
-
- protected SystemMessage emptyMsg, invalidMsg, currentMessage;
-
- /**
- * Constructor to use when wanting to specify the "value required" error message,
- * but use the default for the "Value not valid" error message
- */
- public ValidatorUserActionComment()
- {
- setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMT_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDACMT_NOTVALID));
- }
-
- /**
- * Set the error messages, overriding the defaults
- */
- public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg)
- {
- this.emptyMsg = emptyMsg;
- this.invalidMsg = invalidMsg;
- }
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
- */
- public String isValid(Object input)
- {
- currentMessage = null;
- if (!(input instanceof String))
- {
- return null;
- }
- else
- return isValid((String)input);
- }
- /**
- * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
- * @see #getSystemMessage()
- */
- public String isValid(String input)
- {
- currentMessage = null;
- if ((input==null)||(input.length()==0))
- {
- //currentMessage = emptyMsg;
- }
- else
- {
- if (input.length() > MAX_UDACMT_LENGTH)
- currentMessage = invalidMsg;
- }
- return (currentMessage==null) ? null : currentMessage.getLevelOneText();
- }
-
- /**
- * When isValid returns non-null, call this to get the SystemMessage object for the error
- * versus the simple string message.
- */
- public SystemMessage getSystemMessage()
- {
- return currentMessage;
- }
-
- /**
- * Return the max length for comments
- */
- public int getMaximumNameLength()
- {
- return MAX_UDACMT_LENGTH;
- }
-
- /**
- * For convenience, this is a shortcut to calling:
- *
- * if (isValid(text) != null)
- * msg = getSystemMessage();
- *
- */
- public SystemMessage validate(String text)
- {
- if (isValid(text) != null)
- return currentMessage;
- else
- return null;
- }
-
-}
\ No newline at end of file
Index: UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java
===================================================================
RCS file: UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java
diff -N UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java
--- UI/org/eclipse/rse/ui/validators/ValidatorUserActionName.java 30 May 2007 15:53:22 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,134 +0,0 @@
-/********************************************************************************
- * Copyright (c) 2002, 2006 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
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Initial Contributors:
- * The following IBM employees contributed to the Remote System Explorer
- * component that contains this file: David McKnight, Kushal Munir,
- * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
- * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
- *
- * Contributors:
- * {Name} (company) - description of contribution.
- ********************************************************************************/
-
-package org.eclipse.rse.ui.validators;
-import java.util.Collection;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.rse.services.clientserver.messages.SystemMessage;
-import org.eclipse.rse.ui.ISystemMessages;
-import org.eclipse.rse.ui.RSEUIPlugin;
-
-
-/**
- * This class is used to verify a user defined action's name.
- */
-public class ValidatorUserActionName extends ValidatorUniqueString
- implements ISystemValidator
-{
- public static final int MAX_UDANAME_LENGTH = 256; // max name for an action
-
- protected boolean fUnique;
- protected SystemMessage msg_Invalid;
- protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
-
- /**
- * Use this constructor when the name must be unique.
- * @param existingNameList a collection of existing names to compare against.
- * The collection will not be modified by the validator.
- */
- public ValidatorUserActionName(Collection existingNameList)
- {
- super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
- init();
- }
- /**
- * Use this constructor when the name must be unique. Give the
- * ctor a string array of existing names to compare against.
- */
- public ValidatorUserActionName(String existingNameList[])
- {
- super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
- init();
- }
-
- /**
- * Use this constructor when the name need not be unique, and you just want
- * the syntax checking.
- */
- public ValidatorUserActionName()
- {
- super(new String[0], CASE_SENSITIVE);
- init();
- }
-
- private void init()
- {
- super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_EMPTY),
- RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_NOTUNIQUE));
- fUnique = true;
- msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_NOTVALID);
- }
- /**
- * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
- * @param msg_Empty error message when entry field is empty
- * @param msg_NonUnique error message when value entered is not unique
- * @param msg_Invalid error message when syntax is not valid
- */
- public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid)
- {
- super.setErrorMessages(msg_Empty, msg_NonUnique);
- this.msg_Invalid = msg_Invalid;
- }
-
- /**
- * Overridable method for invalidate character check, beyond what this class offers
- * @return true if valid, false if not
- */
- protected boolean checkForBadCharacters(String newText)
- {
- return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character
- (newText.indexOf('@') == -1)); // defect 43950
- }
-
- public String toString()
- {
- return "UserActionNameValidator class"; //$NON-NLS-1$
- }
-
- // ---------------------------
- // Parent Overrides...
- // ---------------------------
- /**
- * Validate each character.
- * Override of parent method.
- * Override yourself to refine the error checking.
- */
- public SystemMessage isSyntaxOk(String newText)
- {
- if (newText.length() > getMaximumNameLength())
- currentMessage = msg_Invalid;
- else
- currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid;
- return currentMessage;
- }
-
-
- // ---------------------------
- // ISystemValidator methods...
- // ---------------------------
-
- /**
- * Return the max length for folder names: 256
- */
- public int getMaximumNameLength()
- {
- return MAX_UDANAME_LENGTH;
- }
-
-
-}
\ No newline at end of file
Index: UI/org/eclipse/rse/ui/ISystemIconConstants.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemIconConstants.java,v
retrieving revision 1.11
diff -u -r1.11 ISystemIconConstants.java
--- UI/org/eclipse/rse/ui/ISystemIconConstants.java 31 May 2007 18:59:49 -0000 1.11
+++ UI/org/eclipse/rse/ui/ISystemIconConstants.java 4 Jun 2007 18:41:34 -0000
@@ -148,10 +148,6 @@
// OTHER ACTION ICONS...
public static final String ICON_ACTIONS_DIR = "full/elcl16/"; //$NON-NLS-1$
- public static final String ICON_SYSTEM_COMPILE_ROOT = "compile"; //$NON-NLS-1$
- public static final String ICON_SYSTEM_COMPILE = ICON_ACTIONS_DIR + ICON_SYSTEM_COMPILE_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_COMPILE_ID = PREFIX+ICON_SYSTEM_COMPILE_ROOT+ICON_SUFFIX;
-
public static final String ICON_SYSTEM_LOCK_ROOT = "lock"; //$NON-NLS-1$
public static final String ICON_SYSTEM_LOCK = ICON_ACTIONS_DIR + ICON_SYSTEM_LOCK_ROOT+ICON_EXT;
public static final String ICON_SYSTEM_LOCK_ID = PREFIX+ICON_SYSTEM_LOCK_ROOT+ICON_SUFFIX;
@@ -225,18 +221,6 @@
public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_EXT;
public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS_ID = PREFIX+ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_SUFFIX;
- public static final String ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT = "workwithuseractions"; //$NON-NLS-1$
- public static final String ICON_SYSTEM_WORKWITHUSERACTIONS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHUSERACTIONS_ID = PREFIX+ICON_SYSTEM_WORKWITHUSERACTIONS_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT = "workwithnamedtypes"; //$NON-NLS-1$
- public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHNAMEDTYPES_ID = PREFIX+ICON_SYSTEM_WORKWITHNAMEDTYPES_ROOT+ICON_SUFFIX;
-
- public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT = "workwithcompilecmds"; //$NON-NLS-1$
- public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT+ICON_EXT;
- public static final String ICON_SYSTEM_WORKWITHCOMPILECMDS_ID = PREFIX+ICON_SYSTEM_WORKWITHCOMPILECMDS_ROOT+ICON_SUFFIX;
-
public static final String ICON_SYSTEM_SHOW_TABLE_ROOT = "systemshowintable"; //$NON-NLS-1$
public static final String ICON_SYSTEM_SHOW_TABLE = ICON_ACTIONS_DIR + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_EXT;
public static final String ICON_SYSTEM_SHOW_TABLE_ID = PREFIX + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_SUFFIX;
Index: UI/org/eclipse/rse/ui/ISystemMessages.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/ISystemMessages.java,v
retrieving revision 1.10
diff -u -r1.10 ISystemMessages.java
--- UI/org/eclipse/rse/ui/ISystemMessages.java 1 Jun 2007 11:40:35 -0000 1.10
+++ UI/org/eclipse/rse/ui/ISystemMessages.java 4 Jun 2007 18:41:35 -0000
@@ -195,33 +195,10 @@
public static final String MSG_SAVING_PROGRESS = "RSEG1119"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDANAME_EMPTY = "RSEG1180"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDANAME_NOTUNIQUE= "RSEG1181"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDANAME_NOTVALID = "RSEG1182"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDACMT_EMPTY = "RSEG1183"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDACMT_NOTVALID = "RSEG1184"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDACMD_EMPTY = "RSEG1185"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDACMD_NOTVALID = "RSEG1186"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDTNAME_EMPTY = "RSEG1187"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDTNAME_NOTUNIQUE= "RSEG1188"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDTNAME_NOTVALID = "RSEG1189"; //$NON-NLS-1$
-
- public static final String MSG_VALIDATE_UDTTYPES_EMPTY = "RSEG1190"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_UDTTYPES_NOTVALID = "RSEG1191"; //$NON-NLS-1$
-
public static final String MSG_VALIDATE_SRCTYPE_EMPTY = "RSEG1192"; //$NON-NLS-1$
public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$NON-NLS-1$
public static final String MSG_VALIDATE_SRCTYPE_NOTUNIQUE= "RSEG1194"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILELABEL_EMPTY = "RSEG1195"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILELABEL_NOTUNIQUE= "RSEG1196"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILELABEL_NOTVALID = "RSEG1197"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILESTRING_EMPTY = "RSEG1198"; //$NON-NLS-1$
- public static final String MSG_VALIDATE_COMPILESTRING_NOTVALID = "RSEG1199"; //$NON-NLS-1$
-
public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$
@@ -242,15 +219,9 @@
public static final String MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED = "RSEG1068"; //$NON-NLS-1$
public static final String MSG_LOADING_PROFILE_SHOULDNOTBE_DEACTIVATED = "RSEG1069"; //$NON-NLS-1$
- public static final String MSG_UDA_LOAD_ERROR = "RSEG1140"; //$NON-NLS-1$
- public static final String MSG_UDA_ROOTTAG_ERROR = "RSEG1141"; //$NON-NLS-1$
-
public static final String MSG_HOSTNAME_NOTFOUND = "RSEG1220"; //$NON-NLS-1$
public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_DELETE_USERACTION = "RSEG1230"; //$NON-NLS-1$
- public static final String MSG_CONFIRM_DELETE_USERTYPE = "RSEG1231"; //$NON-NLS-1$
-
public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240"; //$NON-NLS-1$
// universal find files
Index: UI/org/eclipse/rse/ui/RSEUIPlugin.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java,v
retrieving revision 1.60
diff -u -r1.60 RSEUIPlugin.java
--- UI/org/eclipse/rse/ui/RSEUIPlugin.java 4 Jun 2007 16:29:25 -0000 1.60
+++ UI/org/eclipse/rse/ui/RSEUIPlugin.java 4 Jun 2007 18:41:35 -0000
@@ -313,8 +313,8 @@
path+ISystemIconConstants.ICON_SYSTEM_RUN);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_STOP_ID,
path+ISystemIconConstants.ICON_SYSTEM_STOP);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID,
- path+ISystemIconConstants.ICON_SYSTEM_COMPILE);
+// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID,
+// path+ISystemIconConstants.ICON_SYSTEM_COMPILE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID,
path+ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEINACTIVE_ID,
@@ -330,12 +330,12 @@
path+ISystemIconConstants.ICON_SYSTEM_SELECTFILTERPOOLS);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS_ID,
path+ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES);
- putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS_ID,
- path+ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS);
+// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID,
+// path+ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS);
+// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES_ID,
+// path+ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES);
+// putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS_ID,
+// path+ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID,
path+ISystemIconConstants.ICON_SYSTEM_REFRESH);
Index: UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java,v
retrieving revision 1.11
diff -u -r1.11 SystemTeamViewPart.java
--- UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java 4 Jun 2007 16:29:24 -0000 1.11
+++ UI/org/eclipse/rse/internal/ui/view/team/SystemTeamViewPart.java 4 Jun 2007 18:41:33 -0000
@@ -932,11 +932,11 @@
// treeViewer.setSelection(new StructuredSelection(action));
// }
// }
- else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE)
- {
- if (testMode)
- System.out.println("Named Type change event of type: " + event.getEventType()); //$NON-NLS-1$
- }
+// else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE)
+// {
+// if (testMode)
+// System.out.println("Named Type change event of type: " + event.getEventType()); //$NON-NLS-1$
+// }
// compile actions separate now
// else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD)
#P org.eclipse.rse.shells.ui
Index: src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java,v
retrieving revision 1.7
diff -u -r1.7 SystemCommandEditor.java
--- src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java 29 Mar 2007 18:56:15 -0000 1.7
+++ src/org/eclipse/rse/shells/ui/view/SystemCommandEditor.java 4 Jun 2007 18:41:37 -0000
@@ -44,7 +44,6 @@
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.validators.ISystemValidator;
-import org.eclipse.rse.ui.validators.ValidatorUserActionCommand;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener;
@@ -105,10 +104,11 @@
}
private void init(int columnSpan, SourceViewerConfiguration sourceViewerConfiguration, String cmd)
{
- if (cmdValidator == null)
- {
- setCommandValidator(new ValidatorUserActionCommand());
- }
+ // TODO (dwd) will need to have an editor callback on instantiation to add validators instead of assuming one
+// if (cmdValidator == null)
+// {
+// setCommandValidator(new ValidatorUserActionCommand());
+// }
IDocument document = new Document();
configure(sourceViewerConfiguration);
setEditable(true);
#P org.eclipse.rse.useractions
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileAction.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileAction.java,v
retrieving revision 1.2
diff -u -r1.2 SystemCompileAction.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileAction.java 15 May 2007 23:54:14 -0000 1.2
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileAction.java 4 Jun 2007 18:41:40 -0000
@@ -6,8 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * 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
*******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.compile;
@@ -19,7 +20,8 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.internal.ui.GenericMessages;
import org.eclipse.rse.internal.ui.view.SystemTableViewProvider;
-import org.eclipse.rse.ui.ISystemIconConstants;
+import org.eclipse.rse.internal.useractions.Activator;
+import org.eclipse.rse.internal.useractions.IUserActionsImageIds;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseAction;
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
@@ -43,7 +45,7 @@
*/
public SystemCompileAction(Shell shell, SystemCompileCommand compileCommand, boolean isPrompt) {
super(
- isPrompt ? compileCommand.getLabel() + "..." : compileCommand.getLabel(), compileCommand.getLabel(), RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID), shell); // null == image //$NON-NLS-1$
+ isPrompt ? compileCommand.getLabel() + "..." : compileCommand.getLabel(), compileCommand.getLabel(), Activator.getDefault().getImageDescriptor(IUserActionsImageIds.COMPILE_1), shell); // null == image //$NON-NLS-1$
this.compileCmd = compileCommand;
this.isPrompt = isPrompt;
SystemCompileManager mgr = compileCommand.getParentType().getParentProfile().getParentManager();
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCascadeByProfileAction.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCascadeByProfileAction.java,v
retrieving revision 1.2
diff -u -r1.2 SystemCompileCascadeByProfileAction.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCascadeByProfileAction.java 15 May 2007 23:54:14 -0000 1.2
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCascadeByProfileAction.java 4 Jun 2007 18:41:40 -0000
@@ -6,8 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * 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
*******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.compile;
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandLabelProvider.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandLabelProvider.java,v
retrieving revision 1.1
diff -u -r1.1 SystemCompileCommandLabelProvider.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandLabelProvider.java 11 Apr 2007 19:51:39 -0000 1.1
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandLabelProvider.java 4 Jun 2007 18:41:41 -0000
@@ -10,9 +10,10 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.rse.ui.ISystemIconConstants;
-import org.eclipse.rse.ui.RSEUIPlugin;
+import org.eclipse.rse.internal.useractions.Activator;
+import org.eclipse.rse.internal.useractions.IUserActionsImageIds;
import org.eclipse.swt.graphics.Image;
/**
@@ -20,6 +21,9 @@
* dialog.
*/
public class SystemCompileCommandLabelProvider extends LabelProvider {
+
+ Image _compileCommandImage = null;
+
/**
* Constructor
*/
@@ -27,8 +31,8 @@
super();
}
- /**
- * Override of parent to return the visual label for the given compile command
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
*/
public String getText(Object element) {
if (element instanceof SystemCompileCommand)
@@ -39,11 +43,19 @@
return null;
}
- /**
- * Override of parent so we can supply an image, if we desire.
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
*/
public Image getImage(Object element) {
- if (element instanceof SystemCompileCommand) return RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID);
- return null;
+ Image result = null;
+ if (element instanceof SystemCompileCommand) {
+ if (_compileCommandImage == null || _compileCommandImage.isDisposed()) {
+ ImageDescriptor id = Activator.getDefault().getImageDescriptor(IUserActionsImageIds.COMPILE_1);
+ _compileCommandImage = id.createImage();
+ }
+ result = _compileCommandImage;
+ }
+ return result;
}
+
}
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsDialog.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsDialog.java,v
retrieving revision 1.4
diff -u -r1.4 SystemWorkWithCompileCommandsDialog.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsDialog.java 15 May 2007 23:54:14 -0000 1.4
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsDialog.java 4 Jun 2007 18:41:43 -0000
@@ -28,6 +28,7 @@
import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
+import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemContextMenuConstants;
@@ -585,10 +586,10 @@
saveCompileCommand(editedCompileCmd, newMode, prevListSelection);
processCommandsListSelected();
if (newMode)
- RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, editedCompileCmd,
+ RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, editedCompileCmd,
null);
else
- RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD,
+ RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD,
editedCompileCmd, null);
}
}
@@ -927,7 +928,7 @@
rmvSrcTypeButton.setEnabled(true);
//traceTest = false;
// fire model change event in case any BP code is listening...
- RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REMOVED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, deletedCmd, null);
+ RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REMOVED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, deletedCmd, null);
}
} catch (Exception exc) {
}
@@ -964,7 +965,7 @@
listView.showSelection();
processCommandsListSelected();
// fire model change event in case any BP code is listening...
- RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REORDERED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, currCmd, null);
+ RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REORDERED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, currCmd, null);
}
/**
@@ -998,7 +999,7 @@
listView.showSelection();
processCommandsListSelected();
// fire model change event in case any BP code is listening...
- RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REORDERED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, currCmd, null);
+ RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REORDERED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, currCmd, null);
}
/**
@@ -1060,7 +1061,7 @@
clipboard.dispose();
clipboard = null;
// fire model change event in case any BP code is listening...
- RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REMOVED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, oldCmd, null);
+ RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_REMOVED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, oldCmd, null);
}
/**
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileManager.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileManager.java,v
retrieving revision 1.4
diff -u -r1.4 SystemCompileManager.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileManager.java 15 May 2007 23:54:14 -0000 1.4
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileManager.java 4 Jun 2007 18:41:41 -0000
@@ -6,9 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM Corporation - initial API and implementation
+ * 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 actions API out of org.eclipse.rse.ui
*******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.compile;
@@ -18,11 +19,11 @@
import org.eclipse.core.resources.IFolder;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
+import org.eclipse.rse.internal.useractions.UserActionsPersistenceUtil;
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;
@@ -210,7 +211,7 @@
}
//System.out.println("systemProfile = " + systemProfile);
//System.out.println("subsystemFactory = " + subsystemFactory);
- IFolder folder = SystemResourceManager.getCompileCommandsFolder(systemProfile, subsystemFactory);
+ IFolder folder = UserActionsPersistenceUtil.getCompileCommandsFolder(systemProfile, subsystemFactory);
return folder;
}
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandEditPane.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandEditPane.java,v
retrieving revision 1.1
diff -u -r1.1 SystemCompileCommandEditPane.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandEditPane.java 11 Apr 2007 19:51:39 -0000 1.1
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemCompileCommandEditPane.java 4 Jun 2007 18:41:41 -0000
@@ -18,13 +18,13 @@
import org.eclipse.rse.internal.useractions.ui.SystemCommandTextField;
import org.eclipse.rse.internal.useractions.ui.SystemCommandViewerConfiguration;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
+import org.eclipse.rse.internal.useractions.ui.validators.ValidatorCompileCommandLabel;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.shells.ui.view.ISystemCommandTextModifyListener;
import org.eclipse.rse.ui.ISystemMassager;
import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.validators.ISystemValidator;
import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString;
-import org.eclipse.rse.ui.validators.ValidatorCompileCommandLabel;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
Index: src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java,v
retrieving revision 1.2
diff -u -r1.2 SystemWorkWithCompileCommandsAction.java
--- src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java 15 May 2007 23:54:14 -0000 1.2
+++ src/org/eclipse/rse/internal/useractions/ui/compile/SystemWorkWithCompileCommandsAction.java 4 Jun 2007 18:41:41 -0000
@@ -17,10 +17,10 @@
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.ui.compile.teamview.SystemTeamViewCompileTypeNode;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.ui.ISystemContextMenuConstants;
-import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
@@ -39,7 +39,7 @@
public SystemWorkWithCompileCommandsAction(Shell shell, boolean fromCascadingCompileAction) {
super(fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWCOMPILE_CMDS_LABEL : SystemUDAResources.ACTION_WORKWITH_COMPILE_CMDS_LABEL,
fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWCOMPILE_CMDS_TOOLTIP : SystemUDAResources.ACTION_WORKWITH_COMPILE_CMDS_TOOLTIP, RSEUIPlugin.getDefault()
- .getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS_ID), shell);
+ .getImageDescriptor(IUserActionsImageIds.WORK_WITH_COMPILE_COMMANDS_1), shell);
allowOnMultipleSelection(false);
if (!fromCascadingCompileAction)
setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);
Index: plugin.properties
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/plugin.properties,v
retrieving revision 1.2
diff -u -r1.2 plugin.properties
--- plugin.properties 22 Mar 2007 15:50:53 -0000 1.2
+++ plugin.properties 4 Jun 2007 18:41:39 -0000
@@ -8,6 +8,7 @@
# Contributors:
# IBM Corporation - initial API and implementation
# Martin Oberhuber (Wind River) - add providerName
+# David Dykstal (IBM) - [186589] move properties from org.eclipse.rse.ui
###############################################################################
# NLS_MESSAGEFORMAT_NONE
@@ -15,3 +16,7 @@
pluginName = RSE User Actions
providerName = Eclipse.org
+
+PropertyPage.TeamViewUserActionNode = User Action Information
+PropertyPage.TeamViewCompileTypeNode = Compile Type Information
+PropertyPage.TeamViewCompileCommandNode = Compile Command Information
Index: plugin.xml
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.useractions/plugin.xml,v
retrieving revision 1.2
diff -u -r1.2 plugin.xml
--- plugin.xml 11 Apr 2007 19:51:44 -0000 1.2
+++ plugin.xml 4 Jun 2007 18:41:39 -0000
@@ -8,25 +8,34 @@
+ * if (isValid(text) != null)
+ * msg = getSystemMessage();
+ *
+ */
+ public SystemMessage validate(String text) {
+ if (isValid(text) != null)
+ return currentMessage;
+ else
+ return null;
+ }
+
+}
Index: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserTypeTypes.java
===================================================================
RCS file: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserTypeTypes.java
diff -N src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserTypeTypes.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserTypeTypes.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,106 @@
+/********************************************************************************
+ * Copyright (c) 2002, 2006 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
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributors:
+ * The following IBM employees contributed to the Remote System Explorer
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.rse.internal.useractions.ui.validators;
+
+import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
+import org.eclipse.rse.services.clientserver.messages.SystemMessage;
+import org.eclipse.rse.ui.RSEUIPlugin;
+import org.eclipse.rse.ui.validators.ISystemValidator;
+
+/**
+ * This class is used to verify a user defined action's comment
+ */
+public class ValidatorUserTypeTypes implements ISystemValidator {
+ public static final int MAX_UDTTYPES_LENGTH = 512;
+
+ protected SystemMessage emptyMsg, invalidMsg, currentMessage;
+
+ /**
+ * Constructor to use when wanting to specify the "value required" error message,
+ * but use the default for the "Value not valid" error message
+ */
+ public ValidatorUserTypeTypes() {
+ setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTTYPES_EMPTY), RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTTYPES_NOTVALID));
+ }
+
+ /**
+ * Set the error messages, overriding the defaults
+ */
+ public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg) {
+ this.emptyMsg = emptyMsg;
+ this.invalidMsg = invalidMsg;
+ }
+
+ // ---------------------------
+ // ISystemValidator methods...
+ // ---------------------------
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
+ */
+ public String isValid(Object input) {
+ currentMessage = null;
+ if (!(input instanceof String)) {
+ return null;
+ } else
+ return isValid((String) input);
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
+ * @see #getSystemMessage()
+ */
+ public String isValid(String input) {
+ currentMessage = null;
+ if ((input == null) || (input.length() == 0)) {
+ currentMessage = emptyMsg;
+ } else {
+ if (input.length() > MAX_UDTTYPES_LENGTH) currentMessage = invalidMsg;
+ }
+ return (currentMessage == null) ? null : currentMessage.getLevelOneText();
+ }
+
+ /**
+ * When isValid returns non-null, call this to get the SystemMessage object for the error
+ * versus the simple string message.
+ */
+ public SystemMessage getSystemMessage() {
+ return currentMessage;
+ }
+
+ /**
+ * Return the max length for comments
+ */
+ public int getMaximumNameLength() {
+ return MAX_UDTTYPES_LENGTH;
+ }
+
+ /**
+ * For convenience, this is a shortcut to calling:
+ *
+ * if (isValid(text) != null)
+ * msg = getSystemMessage();
+ *
+ */
+ public SystemMessage validate(String text) {
+ if (isValid(text) != null)
+ return currentMessage;
+ else
+ return null;
+ }
+
+}
Index: src/org/eclipse/rse/internal/useractions/IUserActionsImageIds.java
===================================================================
RCS file: src/org/eclipse/rse/internal/useractions/IUserActionsImageIds.java
diff -N src/org/eclipse/rse/internal/useractions/IUserActionsImageIds.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/rse/internal/useractions/IUserActionsImageIds.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 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;
+
+public interface IUserActionsImageIds {
+
+ public static final String COMPILE_0 = "COMPILE_0"; //$NON-NLS-1$
+ public static final String COMPILE_1 = "COMPILE_1"; //$NON-NLS-1$
+ public static final String WORK_WITH_USER_ACTIONS_0 = "WORK_WITH_USER_ACTIONS_0"; //$NON-NLS-1$
+ public static final String WORK_WITH_USER_ACTIONS_1 = "WORK_WITH_USER_ACTIONS_1"; //$NON-NLS-1$
+ public static final String WORK_WITH_NAMED_TYPES_0 = "WORK_WITH_NAMED_TYPES_0"; //$NON-NLS-1$
+ public static final String WORK_WITH_NAMED_TYPES_1 = "WORK_WITH_NAMED_TYPES_1"; //$NON-NLS-1$
+ public static final String WORK_WITH_COMPILE_COMMANDS_0 = "WORK_WITH_COMPILE_COMMANDS_0"; //$NON-NLS-1$
+ public static final String WORK_WITH_COMPILE_COMMANDS_1 = "WORK_WITH_COMPILE_COMMANDS_1"; //$NON-NLS-1$
+
+}
Index: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionName.java
===================================================================
RCS file: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionName.java
diff -N src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionName.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionName.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,124 @@
+/********************************************************************************
+ * Copyright (c) 2002, 2006 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
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributors:
+ * The following IBM employees contributed to the Remote System Explorer
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.rse.internal.useractions.ui.validators;
+
+import java.util.Collection;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
+import org.eclipse.rse.services.clientserver.messages.SystemMessage;
+import org.eclipse.rse.ui.RSEUIPlugin;
+import org.eclipse.rse.ui.validators.ISystemValidator;
+import org.eclipse.rse.ui.validators.ValidatorUniqueString;
+
+/**
+ * This class is used to verify a user defined action's name.
+ */
+public class ValidatorUserActionName extends ValidatorUniqueString implements ISystemValidator {
+ public static final int MAX_UDANAME_LENGTH = 256; // max name for an action
+
+ protected boolean fUnique;
+ protected SystemMessage msg_Invalid;
+ protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
+
+ /**
+ * Use this constructor when the name must be unique.
+ * @param existingNameList a collection of existing names to compare against.
+ * The collection will not be modified by the validator.
+ */
+ public ValidatorUserActionName(Collection existingNameList) {
+ super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
+ init();
+ }
+
+ /**
+ * Use this constructor when the name must be unique. Give the
+ * ctor a string array of existing names to compare against.
+ */
+ public ValidatorUserActionName(String existingNameList[]) {
+ super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
+ init();
+ }
+
+ /**
+ * Use this constructor when the name need not be unique, and you just want
+ * the syntax checking.
+ */
+ public ValidatorUserActionName() {
+ super(new String[0], CASE_SENSITIVE);
+ init();
+ }
+
+ private void init() {
+ super.setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDANAME_EMPTY), RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDANAME_NOTUNIQUE));
+ fUnique = true;
+ msg_Invalid = RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDANAME_NOTVALID);
+ }
+
+ /**
+ * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
+ * @param msg_Empty error message when entry field is empty
+ * @param msg_NonUnique error message when value entered is not unique
+ * @param msg_Invalid error message when syntax is not valid
+ */
+ public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) {
+ super.setErrorMessages(msg_Empty, msg_NonUnique);
+ this.msg_Invalid = msg_Invalid;
+ }
+
+ /**
+ * Overridable method for invalidate character check, beyond what this class offers
+ * @return true if valid, false if not
+ */
+ protected boolean checkForBadCharacters(String newText) {
+ return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character
+ (newText.indexOf('@') == -1)); // defect 43950
+ }
+
+ public String toString() {
+ return "UserActionNameValidator class"; //$NON-NLS-1$
+ }
+
+ // ---------------------------
+ // Parent Overrides...
+ // ---------------------------
+ /**
+ * Validate each character.
+ * Override of parent method.
+ * Override yourself to refine the error checking.
+ */
+ public SystemMessage isSyntaxOk(String newText) {
+ if (newText.length() > getMaximumNameLength())
+ currentMessage = msg_Invalid;
+ else
+ currentMessage = checkForBadCharacters(newText) ? null : msg_Invalid;
+ return currentMessage;
+ }
+
+ // ---------------------------
+ // ISystemValidator methods...
+ // ---------------------------
+
+ /**
+ * Return the max length for folder names: 256
+ */
+ public int getMaximumNameLength() {
+ return MAX_UDANAME_LENGTH;
+ }
+
+}
Index: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionComment.java
===================================================================
RCS file: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionComment.java
diff -N src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionComment.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorUserActionComment.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,106 @@
+/********************************************************************************
+ * Copyright (c) 2002, 2006 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
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributors:
+ * The following IBM employees contributed to the Remote System Explorer
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.rse.internal.useractions.ui.validators;
+
+import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
+import org.eclipse.rse.services.clientserver.messages.SystemMessage;
+import org.eclipse.rse.ui.RSEUIPlugin;
+import org.eclipse.rse.ui.validators.ISystemValidator;
+
+/**
+ * This class is used to verify a user defined action's comment
+ */
+public class ValidatorUserActionComment implements ISystemValidator {
+ public static final int MAX_UDACMT_LENGTH = 256; // max comment for an action
+
+ protected SystemMessage emptyMsg, invalidMsg, currentMessage;
+
+ /**
+ * Constructor to use when wanting to specify the "value required" error message,
+ * but use the default for the "Value not valid" error message
+ */
+ public ValidatorUserActionComment() {
+ setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDACMT_EMPTY), RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDACMT_NOTVALID));
+ }
+
+ /**
+ * Set the error messages, overriding the defaults
+ */
+ public void setErrorMessages(SystemMessage emptyMsg, SystemMessage invalidMsg) {
+ this.emptyMsg = emptyMsg;
+ this.invalidMsg = invalidMsg;
+ }
+
+ // ---------------------------
+ // ISystemValidator methods...
+ // ---------------------------
+
+ /**
+ * @see org.eclipse.jface.viewers.ICellEditorValidator#isValid(java.lang.Object)
+ */
+ public String isValid(Object input) {
+ currentMessage = null;
+ if (!(input instanceof String)) {
+ return null;
+ } else
+ return isValid((String) input);
+ }
+
+ /**
+ * @see org.eclipse.jface.dialogs.IInputValidator#isValid(java.lang.String)
+ * @see #getSystemMessage()
+ */
+ public String isValid(String input) {
+ currentMessage = null;
+ if ((input == null) || (input.length() == 0)) {
+ //currentMessage = emptyMsg;
+ } else {
+ if (input.length() > MAX_UDACMT_LENGTH) currentMessage = invalidMsg;
+ }
+ return (currentMessage == null) ? null : currentMessage.getLevelOneText();
+ }
+
+ /**
+ * When isValid returns non-null, call this to get the SystemMessage object for the error
+ * versus the simple string message.
+ */
+ public SystemMessage getSystemMessage() {
+ return currentMessage;
+ }
+
+ /**
+ * Return the max length for comments
+ */
+ public int getMaximumNameLength() {
+ return MAX_UDACMT_LENGTH;
+ }
+
+ /**
+ * For convenience, this is a shortcut to calling:
+ *
+ * if (isValid(text) != null)
+ * msg = getSystemMessage();
+ *
+ */
+ public SystemMessage validate(String text) {
+ if (isValid(text) != null)
+ return currentMessage;
+ else
+ return null;
+ }
+
+}
Index: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorCompileCommandLabel.java
===================================================================
RCS file: src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorCompileCommandLabel.java
diff -N src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorCompileCommandLabel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/rse/internal/useractions/ui/validators/ValidatorCompileCommandLabel.java 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,123 @@
+/********************************************************************************
+ * Copyright (c) 2002, 2006 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
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Initial Contributors:
+ * The following IBM employees contributed to the Remote System Explorer
+ * component that contains this file: David McKnight, Kushal Munir,
+ * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
+ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
+ *
+ * Contributors:
+ * {Name} (company) - description of contribution.
+ ********************************************************************************/
+
+package org.eclipse.rse.internal.useractions.ui.validators;
+
+import java.util.Collection;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
+import org.eclipse.rse.services.clientserver.messages.SystemMessage;
+import org.eclipse.rse.ui.RSEUIPlugin;
+import org.eclipse.rse.ui.validators.ISystemValidator;
+import org.eclipse.rse.ui.validators.ValidatorUniqueString;
+
+/**
+ * This class is used to verify a user defined compile command's label
+ */
+public class ValidatorCompileCommandLabel extends ValidatorUniqueString implements ISystemValidator {
+ public static final int MAX_CMDLABEL_LENGTH = 50; // max name for a compile command name
+
+ protected boolean fUnique;
+ protected SystemMessage msg_Invalid;
+ protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
+
+ /**
+ * Use this constructor when you have a list of existing labels.
+ * The collection will not be modified by the validator.
+ */
+ public ValidatorCompileCommandLabel(Collection existingLabelList) {
+ super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
+ init();
+ }
+
+ /**
+ * Use this constructor when you have an array of existing labels.
+ */
+ public ValidatorCompileCommandLabel(String existingLabelList[]) {
+ super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
+ init();
+ }
+
+ /**
+ * Use this constructor when the name need not be unique, and you just want
+ * the syntax checking. Or if you will call setExistingNamesList later.
+ */
+ public ValidatorCompileCommandLabel() {
+ super(new String[0], CASE_INSENSITIVE);
+ init();
+ }
+
+ private void init() {
+ super.setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_COMPILELABEL_EMPTY), RSEUIPlugin
+ .getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_COMPILELABEL_NOTUNIQUE));
+ fUnique = true;
+ msg_Invalid = RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_COMPILELABEL_NOTVALID);
+ }
+
+ /**
+ * Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used.
+ * @param msg_Empty error message when entry field is empty
+ * @param msg_NonUnique error message when value entered is not unique
+ * @param msg_Invalid error message when syntax is not valid
+ */
+ public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) {
+ super.setErrorMessages(msg_Empty, msg_NonUnique);
+ this.msg_Invalid = msg_Invalid;
+ }
+
+ /**
+ * Overridable method for invalidate character check, beyond what this class offers
+ * @return true if valid, false if not
+ */
+ protected boolean checkForBadCharacters(String newText) {
+ return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character.
+ (newText.indexOf('@') == -1)); // defect 43950
+ }
+
+ public String toString() {
+ return getClass().getName();
+ }
+
+ // ---------------------------
+ // Parent Overrides...
+ // ---------------------------
+ /**
+ * Validate each character.
+ * Override of parent method.
+ * Override yourself to refine the error checking.
+ */
+ public SystemMessage isSyntaxOk(String newText) {
+ if (newText.length() > getMaximumNameLength())
+ currentMessage = msg_Invalid;
+ else
+ currentMessage = checkForBadCharacters(newText) ? null : msg_Invalid;
+ return currentMessage;
+ }
+
+ // ---------------------------
+ // ISystemValidator methods...
+ // ---------------------------
+
+ /**
+ * Return the max length for compile commands: 50
+ */
+ public int getMaximumNameLength() {
+ return MAX_CMDLABEL_LENGTH;
+ }
+
+}
#P org.eclipse.rse.core
Index: src/org/eclipse/rse/core/events/ISystemModelChangeEvents.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/events/ISystemModelChangeEvents.java,v
retrieving revision 1.1
diff -u -r1.1 ISystemModelChangeEvents.java
--- src/org/eclipse/rse/core/events/ISystemModelChangeEvents.java 23 Apr 2007 13:41:53 -0000 1.1
+++ src/org/eclipse/rse/core/events/ISystemModelChangeEvents.java 4 Jun 2007 18:41:51 -0000
@@ -12,6 +12,7 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
+ * David Dykstal (IBM) - Move User Actions events to the user actions plugin
********************************************************************************/
package org.eclipse.rse.core.events;
@@ -84,18 +85,18 @@
* Resource Type: filter
*/
public static final int SYSTEM_RESOURCETYPE_FILTER = 32;
- /**
- * Resource Type: user action
- */
- public static final int SYSTEM_RESOURCETYPE_USERACTION = 128;
- /**
- * Resource Type: named type, which are used in user actions
- */
- public static final int SYSTEM_RESOURCETYPE_NAMEDTYPE = 256;
- /**
- * Resource Type: compile command
- */
- public static final int SYSTEM_RESOURCETYPE_COMPILECMD = 512;
+// /**
+// * Resource Type: user action
+// */
+// public static final int SYSTEM_RESOURCETYPE_USERACTION = 128;
+// /**
+// * Resource Type: named type, which are used in user actions
+// */
+// public static final int SYSTEM_RESOURCETYPE_NAMEDTYPE = 256;
+// /**
+// * Resource Type: compile command
+// */
+// public static final int SYSTEM_RESOURCETYPE_COMPILECMD = 512;
/**
* Resource Type: ALL. Used with SYSTEM_RESOURCE_ALL_RELOADED
*/
Index: src/org/eclipse/rse/core/SystemResourceManager.java
===================================================================
RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/SystemResourceManager.java,v
retrieving revision 1.6
diff -u -r1.6 SystemResourceManager.java
--- src/org/eclipse/rse/core/SystemResourceManager.java 4 Jun 2007 16:29:15 -0000 1.6
+++ src/org/eclipse/rse/core/SystemResourceManager.java 4 Jun 2007 18:41:51 -0000
@@ -277,120 +277,6 @@
return getResourceHelpers().getOrCreateFolder(getRemoteSystemsProject(),profileName);
}
- /*
- * --------------------------------------------------------------------------------------------------------------------------------
- * USER ACTIONS SUBTREE FOLDER METHODS...
- * ======================================
- * .--- Team (folder) - getProfileFolder(SystemProfile/"team")
- * | |
- * | |
- * | .--- UserActions (folder) - getUserActionsFolder(SystemProfile/"team")
- * | |
- * | .--- SubSystemConfigurationID1 (folder) - getUserActionsFolder(SystemProfile/"team", SubSystemConfiguration)
- * | | .--- actions.xml (file)
- * | .--- SubSystemConfigurationID2 (folder)
- * | .--- actions.xml (file)
- * --------------------------------------------------------------------------------------------------------------------------------
- */
- // ---------------------------------------------------
- // GET USER DEFINED ACTIONS ROOT FOLDER PER PROFILE...
- // ---------------------------------------------------
- /**
- * Get user defined actions root folder given a system profile name
- */
- protected static IFolder getUserActionsFolder(String profileName)
- {
- return getResourceHelpers().getOrCreateFolder(getProfileFolder(profileName),RESOURCE_USERACTIONS_FOLDER_NAME);
- }
- /**
- * Get user defined actions root folder given a system profile object and subsystem factory
- */
- public static IFolder getUserActionsFolder(ISystemProfile profile, ISubSystemConfiguration ssFactory)
- {
- return getUserActionsFolder(profile.getName(),ssFactory);
- }
- /**
- * Get user defined actions root folder given a system profile name and subsystem factory
- */
- public static IFolder getUserActionsFolder(String profileName, ISubSystemConfiguration ssFactory)
- {
- IFolder parentFolder = getUserActionsFolder(profileName);
- String folderName = getFolderName(ssFactory);
- return getResourceHelpers().getOrCreateFolder(parentFolder, folderName); // Do create it.
- }
- /**
- * Test for existence of user defined actions root folder given a system profile name and subsystem factory
- */
- public static boolean testUserActionsFolder(String profileName, ISubSystemConfiguration ssFactory)
- {
- IFolder parentFolder = getUserActionsFolder(profileName);
- String folderName = getFolderName(ssFactory);
- return (getResourceHelpers().getFolder(parentFolder, folderName).exists()); // Do NOT create it.
- }
-
- /**
- * Get user defined actions root folder given a system profile name and subsystem factory Id.
- * This is a special-needs method provided for the Import action processing,
- * when a subsystem instance is not available.
- */
- public static IFolder getUserActionsFolder( String profileName, String factoryId)
- {
- IFolder parentFolder = getUserActionsFolder(profileName);
- return getResourceHelpers().getOrCreateFolder(parentFolder, factoryId); // Do create it.
- }
-
- /*
- * --------------------------------------------------------------------------------------------------------------------------------
- * COMPILE COMMAND SUBTREE FOLDER METHODS...
- * ======================================
- * .--- Team (folder) - getProfileFolder(SystemProfile/"team")
- * | |
- * | |
- * | .--- CompileCommands (folder) - getCompileCommandsFolder(SystemProfile/"team")
- * | |
- * | .--- SubSystemConfigurationID1 (folder) - getCompileCommandsFolder(SystemProfile/"team", SubSystemConfiguration)
- * | | .--- compileCommands.xml (file)
- * | .--- SubSystemConfigurationID2 (folder)
- * | .--- compileCommands.xml (file)
- * --------------------------------------------------------------------------------------------------------------------------------
- */
- // ---------------------------------------------------
- // GET COMPILE COMMANDS ROOT FOLDER PER PROFILE...
- // ---------------------------------------------------
- /**
- * Get compile commands root folder given a system profile name
- */
- protected static IFolder getCompileCommandsFolder(String profileName)
- {
- return getResourceHelpers().getOrCreateFolder(getProfileFolder(profileName),RESOURCE_COMPILECOMMANDS_FOLDER_NAME);
- }
- /**
- * Get compile commands root folder given a system profile object and subsystem factory
- */
- public static IFolder getCompileCommandsFolder(ISystemProfile profile, ISubSystemConfiguration ssFactory)
- {
- return getCompileCommandsFolder(profile.getName(),ssFactory);
- }
- /**
- * Get compile commands root folder given a system profile name and subsystem factory
- */
- public static IFolder getCompileCommandsFolder(String profileName, ISubSystemConfiguration ssFactory)
- {
- IFolder parentFolder = getCompileCommandsFolder(profileName);
- String folderName = getFolderName(ssFactory);
- return getResourceHelpers().getOrCreateFolder(parentFolder, folderName); // Do create it.
- }
-
- /**
- * Get compile commands root folder given a system profile name and subsystem factory Id.
- * This is a special-needs method provided for the Import action processing,
- * when a subsystem instance is not available.
- */
- public static IFolder getCompileCommandsFolder( String profileName, String factoryId)
- {
- IFolder parentFolder = getCompileCommandsFolder(profileName);
- return getResourceHelpers().getOrCreateFolder(parentFolder, factoryId); // Do create it.
- }
// -------------------
// FOLDER ACTIONS...
@@ -534,38 +420,4 @@
return SystemResourceHelpers.testIfResourceInUse(resource);
}
- /*
- * --------------------------------------------------------------------------------------------------------------------------------
- * TYPE FILTERS SUBTREE FOLDER METHODS...
- * ======================================
- * .--- TypeFilters (folder) - getTypeFiltersFolder()
- * .--- SubSystemConfigurationID1 (folder) - getTypeFiltersFolder(SubSystemConfiguration)
- * | .--- typefilters.xmi (file)
- * --------------------------------------------------------------------------------------------------------------------------------
- */
-
- /**
- * Get the typeFilters root folder
- */
- public static IFolder getTypeFiltersFolder()
- {
- return getResourceHelpers().getFolder(getRemoteSystemsProject(),RESOURCE_TYPE_FILTERS_FOLDER_NAME);
- }
- /**
- * Get the typeFilters sub-folder per subsystem factory object
- */
- public static IFolder getTypeFiltersFolder(ISubSystemConfiguration ssFactory)
- {
- IFolder parentFolder = getTypeFiltersFolder();
- String folderName = getFolderName(ssFactory);
- return getResourceHelpers().getOrCreateFolder(parentFolder, folderName); // DO create it.
- }
- /**
- * Get the typeFilters sub-folder per subsystem factory id
- */
- public static IFolder getTypeFiltersFolder(String ssFactoryId)
- {
- IFolder parentFolder = getTypeFiltersFolder();
- return getResourceHelpers().getOrCreateFolder(parentFolder, ssFactoryId); // DO create it.
- }
}
\ No newline at end of file