1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 23:05:47 +02:00

[186589][api] move user defined types, user defined actions, and compile commands API to user actions plugin

This commit is contained in:
David Dykstal 2007-06-05 01:39:51 +00:00
parent 4b25985894
commit 56824e4bbe
53 changed files with 1010 additions and 857 deletions

View file

@ -17,6 +17,8 @@
* removed unneeded first time logic and flags * removed unneeded first time logic and flags
* renamed createRemoteSystemsProjectInternal to ensureRemoteSystemsProject * renamed createRemoteSystemsProjectInternal to ensureRemoteSystemsProject
* made ensureRemoteSystemsProject private instead of protected * made ensureRemoteSystemsProject private instead of protected
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core; package org.eclipse.rse.core;
@ -36,7 +38,6 @@ import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemHostPool; import org.eclipse.rse.core.model.ISystemHostPool;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.core.RemoteSystemsProject; import org.eclipse.rse.internal.core.RemoteSystemsProject;
import org.eclipse.rse.internal.core.SystemResourceConstants; import org.eclipse.rse.internal.core.SystemResourceConstants;
@ -277,120 +278,6 @@ public class SystemResourceManager implements SystemResourceConstants
return getResourceHelpers().getOrCreateFolder(getRemoteSystemsProject(),profileName); 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... // FOLDER ACTIONS...
@ -534,38 +421,4 @@ public class SystemResourceManager implements SystemResourceConstants
return SystemResourceHelpers.testIfResourceInUse(resource); 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.
}
} }

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* David Dykstal (IBM) - [186589] Move User Actions events to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.events; package org.eclipse.rse.core.events;
@ -84,18 +85,18 @@ public interface ISystemModelChangeEvents {
* Resource Type: filter * Resource Type: filter
*/ */
public static final int SYSTEM_RESOURCETYPE_FILTER = 32; public static final int SYSTEM_RESOURCETYPE_FILTER = 32;
/** // /**
* Resource Type: user action // * Resource Type: user action
*/ // */
public static final int SYSTEM_RESOURCETYPE_USERACTION = 128; // public static final int SYSTEM_RESOURCETYPE_USERACTION = 128;
/** // /**
* Resource Type: named type, which are used in user actions // * Resource Type: named type, which are used in user actions
*/ // */
public static final int SYSTEM_RESOURCETYPE_NAMEDTYPE = 256; // public static final int SYSTEM_RESOURCETYPE_NAMEDTYPE = 256;
/** // /**
* Resource Type: compile command // * Resource Type: compile command
*/ // */
public static final int SYSTEM_RESOURCETYPE_COMPILECMD = 512; // public static final int SYSTEM_RESOURCETYPE_COMPILECMD = 512;
/** /**
* Resource Type: ALL. Used with SYSTEM_RESOURCE_ALL_RELOADED * Resource Type: ALL. Used with SYSTEM_RESOURCE_ALL_RELOADED
*/ */

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation and others. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,8 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - fix 158765: content assist miss disables enter * Martin Oberhuber (Wind River) - fix 158765: content assist miss disables enter
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.shells.ui.view; package org.eclipse.rse.shells.ui.view;
@ -44,7 +46,6 @@ import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener; import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.validators.ISystemValidator; import org.eclipse.rse.ui.validators.ISystemValidator;
import org.eclipse.rse.ui.validators.ValidatorUserActionCommand;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.VerifyKeyListener; import org.eclipse.swt.custom.VerifyKeyListener;
@ -105,10 +106,11 @@ public class SystemCommandEditor extends SourceViewer
} }
private void init(int columnSpan, SourceViewerConfiguration sourceViewerConfiguration, String cmd) private void init(int columnSpan, SourceViewerConfiguration sourceViewerConfiguration, String cmd)
{ {
if (cmdValidator == null) // TODO (dwd) will need to have an editor callback on instantiation to add validators instead of assuming one
{ // if (cmdValidator == null)
setCommandValidator(new ValidatorUserActionCommand()); // {
} // setCommandValidator(new ValidatorUserActionCommand());
// }
IDocument document = new Document(); IDocument document = new Document();
configure(sourceViewerConfiguration); configure(sourceViewerConfiguration);
setEditable(true); setEditable(true);

View file

@ -14,6 +14,8 @@
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* David Dykstal (IBM) - [189858] Removed the remote systems project in the team view * David Dykstal (IBM) - [189858] Removed the remote systems project in the team view
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view.team; package org.eclipse.rse.internal.ui.view.team;
@ -932,11 +934,11 @@ public class SystemTeamViewPart
// treeViewer.setSelection(new StructuredSelection(action)); // treeViewer.setSelection(new StructuredSelection(action));
// } // }
// } // }
else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE) // else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE)
{ // {
if (testMode) // if (testMode)
System.out.println("Named Type change event of type: " + event.getEventType()); //$NON-NLS-1$ // System.out.println("Named Type change event of type: " + event.getEventType()); //$NON-NLS-1$
} // }
// compile actions separate now // compile actions separate now
// else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD) // else if (resourceType == ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD)

View file

@ -14,6 +14,8 @@
* Michael Berger (IBM) - 146339 Added refresh action graphic. * Michael Berger (IBM) - 146339 Added refresh action graphic.
* Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui * Martin Oberhuber (Wind River) - [174945] split importexport icons from rse.ui
* Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
@ -148,10 +150,6 @@ public interface ISystemIconConstants
// OTHER ACTION ICONS... // OTHER ACTION ICONS...
public static final String ICON_ACTIONS_DIR = "full/elcl16/"; //$NON-NLS-1$ 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_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 = ICON_ACTIONS_DIR + ICON_SYSTEM_LOCK_ROOT+ICON_EXT;
public static final String ICON_SYSTEM_LOCK_ID = PREFIX+ICON_SYSTEM_LOCK_ROOT+ICON_SUFFIX; public static final String ICON_SYSTEM_LOCK_ID = PREFIX+ICON_SYSTEM_LOCK_ROOT+ICON_SUFFIX;
@ -225,18 +223,6 @@ public interface ISystemIconConstants
public static final String ICON_SYSTEM_WORKWITHFILTERPOOLS = ICON_ACTIONS_DIR + ICON_SYSTEM_WORKWITHFILTERPOOLS_ROOT+ICON_EXT; 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_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_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 = 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; public static final String ICON_SYSTEM_SHOW_TABLE_ID = PREFIX + ICON_SYSTEM_SHOW_TABLE_ROOT + ICON_SUFFIX;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2000, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,8 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
@ -195,33 +196,10 @@ public interface ISystemMessages
public static final String MSG_SAVING_PROGRESS = "RSEG1119"; //$NON-NLS-1$ 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_EMPTY = "RSEG1192"; //$NON-NLS-1$
public static final String MSG_VALIDATE_SRCTYPE_NOTVALID = "RSEG1193"; //$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_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$ public static final String MSG_VALIDATE_ARCHIVE_NAME = "RSEG1120"; //$NON-NLS-1$
@ -242,15 +220,9 @@ public interface ISystemMessages
public static final String MSG_LOADING_PROFILE_SHOULDBE_ACTIVATED = "RSEG1068"; //$NON-NLS-1$ 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_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_NOTFOUND = "RSEG1220"; //$NON-NLS-1$
public static final String MSG_HOSTNAME_VERIFYING = "RSEG1221"; //$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$ public static final String MSG_WIZARD_PAGE_ERROR = "RSEG1240"; //$NON-NLS-1$
// universal find files // universal find files

View file

@ -24,6 +24,8 @@
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
* David Dykstal (IBM) - [189858] Delay the creation of the remote systems project * David Dykstal (IBM) - [189858] Delay the creation of the remote systems project
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
@ -313,8 +315,8 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi
path+ISystemIconConstants.ICON_SYSTEM_RUN); path+ISystemIconConstants.ICON_SYSTEM_RUN);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_STOP_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_STOP_ID,
path+ISystemIconConstants.ICON_SYSTEM_STOP); path+ISystemIconConstants.ICON_SYSTEM_STOP);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID, // putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID,
path+ISystemIconConstants.ICON_SYSTEM_COMPILE); // path+ISystemIconConstants.ICON_SYSTEM_COMPILE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE_ID,
path+ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE); path+ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEACTIVE);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEINACTIVE_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_MAKEPROFILEINACTIVE_ID,
@ -330,12 +332,12 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi
path+ISystemIconConstants.ICON_SYSTEM_SELECTFILTERPOOLS); path+ISystemIconConstants.ICON_SYSTEM_SELECTFILTERPOOLS);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS_ID,
path+ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS); path+ISystemIconConstants.ICON_SYSTEM_WORKWITHFILTERPOOLS);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID, // putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID,
path+ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS); // path+ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES_ID, // putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES_ID,
path+ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES); // path+ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS_ID, // putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS_ID,
path+ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS); // path+ISystemIconConstants.ICON_SYSTEM_WORKWITHCOMPILECMDS);
putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID, putImageInRegistry(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID,
path+ISystemIconConstants.ICON_SYSTEM_REFRESH); path+ISystemIconConstants.ICON_SYSTEM_REFRESH);

View file

@ -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:
* <pre><code>
* if (isValid(text) != null)
* msg = getSystemMessage();
* </code></pre>
*/
public SystemMessage validate(String text)
{
if (isValid(text) != null)
return currentMessage;
else
return null;
}
}

View file

@ -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:
* <pre><code>
* if (isValid(text) != null)
* msg = getSystemMessage();
* </code></pre>
*/
public SystemMessage validate(String text)
{
if (isValid(text) != null)
return currentMessage;
else
return null;
}
}

View file

@ -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:
* <pre><code>
* if (isValid(text) != null)
* msg = getSystemMessage();
* </code></pre>
*/
public SystemMessage validate(String text)
{
if (isValid(text) != null)
return currentMessage;
else
return null;
}
}

View file

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 241 B

View file

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 366 B

View file

@ -8,6 +8,7 @@
# Contributors: # Contributors:
# IBM Corporation - initial API and implementation # IBM Corporation - initial API and implementation
# Martin Oberhuber (Wind River) - add providerName # Martin Oberhuber (Wind River) - add providerName
# David Dykstal (IBM) - [186589] move properties from org.eclipse.rse.ui
############################################################################### ###############################################################################
# NLS_MESSAGEFORMAT_NONE # NLS_MESSAGEFORMAT_NONE
@ -15,3 +16,7 @@
pluginName = RSE User Actions pluginName = RSE User Actions
providerName = Eclipse.org providerName = Eclipse.org
PropertyPage.TeamViewUserActionNode = User Action Information
PropertyPage.TeamViewCompileTypeNode = Compile Type Information
PropertyPage.TeamViewCompileCommandNode = Compile Command Information

View file

@ -8,25 +8,34 @@
<extension <extension
point="org.eclipse.ui.propertyPages"> point="org.eclipse.ui.propertyPages">
<page <page
objectClass="org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionElement"
name="%PropertyPage.TeamViewUserActionNode" name="%PropertyPage.TeamViewUserActionNode"
class="org.eclipse.rse.internal.useractions.ui.propertypages.SystemTeamViewUserActionPropertyPage" class="org.eclipse.rse.internal.useractions.ui.propertypages.SystemTeamViewUserActionPropertyPage"
id="org.eclipse.rse.ui.SystemTeamViewUserActionPropertyPage"> id="org.eclipse.rse.ui.SystemTeamViewUserActionPropertyPage">
<enabledWhen>
<instanceof
value="org.eclipse.rse.internal.useractions.ui.uda.SystemUDActionElement">
</instanceof>
</enabledWhen>
</page> </page>
<page <page
objectClass="org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileTypeNode"
name="%PropertyPage.TeamViewCompileTypeNode" name="%PropertyPage.TeamViewCompileTypeNode"
class="org.eclipse.rse.internal.useractions.ui.propertypages.SystemTeamViewCompileTypePropertyPage" class="org.eclipse.rse.internal.useractions.ui.propertypages.SystemTeamViewCompileTypePropertyPage"
id="org.eclipse.rse.ui.SystemTeamViewCompileTypePropertyPage"> id="org.eclipse.rse.ui.SystemTeamViewCompileTypePropertyPage">
<enabledWhen>
<instanceof
value="org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileTypeNode">
</instanceof>
</enabledWhen>
</page> </page>
<page <page
objectClass="org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileCommandNode"
name="%PropertyPage.TeamViewCompileCommandNode" name="%PropertyPage.TeamViewCompileCommandNode"
class="org.eclipse.rse.internal.useractions.ui.propertypages.SystemTeamViewCompileCommandPropertyPage" class="org.eclipse.rse.internal.useractions.ui.propertypages.SystemTeamViewCompileCommandPropertyPage"
id="com.ibm.etools.systems.SystemTeamViewCompileCommandPropertyPage"> id="com.ibm.etools.systems.SystemTeamViewCompileCommandPropertyPage">
<enabledWhen>
<instanceof
value="org.eclipse.rse.internal.useractions.ui.compile.teamview.SystemTeamViewCompileCommandNode">
</instanceof>
</enabledWhen>
</page> </page>
</extension> </extension>
</plugin> </plugin>

View file

@ -6,11 +6,15 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user actions API out of org.eclipse.rse.ui
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.useractions; package org.eclipse.rse.internal.useractions;
import java.net.URL;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
@ -50,14 +54,33 @@ public class Activator extends AbstractUIPlugin {
return plugin; return plugin;
} }
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
*/
protected void initializeImageRegistry(ImageRegistry registry) {
super.initializeImageRegistry(registry);
registry.put(IUserActionsImageIds.COMPILE_0, getImageDescriptor("icons/full/dlcl16/compile.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.COMPILE_1, getImageDescriptor("icons/full/elcl16/compile.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.WORK_WITH_COMPILE_COMMANDS_0, getImageDescriptor("icons/full/dlcl16/workwithcompilecmds.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.WORK_WITH_COMPILE_COMMANDS_1, getImageDescriptor("icons/full/elcl16/workwithcompilecmds.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.WORK_WITH_NAMED_TYPES_0, getImageDescriptor("icons/full/dlcl16/workwithnamedtypes.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.WORK_WITH_NAMED_TYPES_1, getImageDescriptor("icons/full/elcl16/workwithnamedtypes.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.WORK_WITH_USER_ACTIONS_0, getImageDescriptor("icons/full/dlcl16/workwithuseractions.gif")); //$NON-NLS-1$
registry.put(IUserActionsImageIds.WORK_WITH_USER_ACTIONS_1, getImageDescriptor("icons/full/elcl16/workwithuseractions.gif")); //$NON-NLS-1$
}
/** /**
* Returns an image descriptor for the image file at the given * Gets the image descriptor for images in the plugin bundle.
* plug-in relative path. * @param path the plugin relative path of the image
*
* @param path the path
* @return the image descriptor * @return the image descriptor
*/ */
public static ImageDescriptor getImageDescriptor(String path) { public ImageDescriptor getImageDescriptor(String path) {
return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.rse.useractions", path); //$NON-NLS-1$ ImageDescriptor descriptor = null;
URL url = getBundle().getResource(path);
if (url != null) {
descriptor = ImageDescriptor.createFromURL(url);
}
return descriptor;
} }
} }

View file

@ -0,0 +1,25 @@
/*******************************************************************************
* 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:
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/
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$
}

View file

@ -0,0 +1,38 @@
/*******************************************************************************
* 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:
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/
package org.eclipse.rse.internal.useractions;
public interface IUserActionsMessageIds {
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_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_UDA_LOAD_ERROR = "RSEG1140"; //$NON-NLS-1$
public static final String MSG_UDA_ROOTTAG_ERROR = "RSEG1141"; //$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$
}

View file

@ -0,0 +1,32 @@
/*******************************************************************************
* 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:
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/
package org.eclipse.rse.internal.useractions;
/*
* These constants for model change events were taken from ISystemModelChangeEvents.
*/
public interface IUserActionsModelChangeEvents {
/**
* 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;
}

View file

@ -6,7 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * 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; package org.eclipse.rse.internal.useractions;
@ -103,7 +105,7 @@ public class UserActionsIcon {
* @return the image descriptor * @return the image descriptor
*/ */
public ImageDescriptor getImageDescriptor() { public ImageDescriptor getImageDescriptor() {
ImageDescriptor descriptor = Activator.getImageDescriptor(location); ImageDescriptor descriptor = Activator.getDefault().getImageDescriptor(location);
return descriptor; return descriptor;
} }

View file

@ -0,0 +1,212 @@
/*******************************************************************************
* 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
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/
package org.eclipse.rse.internal.useractions;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
/**
* This class is a placeholder documenting the old persistence API and structure for
* user actions, user type filters, and compile commands.
* The class is not functional.
* TODO: (dwd) this needs to be replaced with the new persistence provider scheme.
*/
public class UserActionsPersistenceUtil {
/*
* Bogus infrastructure to make this compile
*/
private static class ResourceHelpers {
IFolder getOrCreateFolder(IFolder parent, String folderName) {
return null;
}
IFolder getFolder(IContainer parent, String folderName) {
return null;
}
}
private static ResourceHelpers getResourceHelpers() {
return new ResourceHelpers();
}
private static IFolder getProfileFolder(String profileName) {
return null;
}
private static String getFolderName(ISubSystemConfiguration subystemConfiguration) {
return null;
}
private static IProject getRemoteSystemsProject() {
return null;
}
private static final String RESOURCE_USERACTIONS_FOLDER_NAME = null;
private static final String RESOURCE_COMPILECOMMANDS_FOLDER_NAME = null;
private static final String RESOURCE_TYPE_FILTERS_FOLDER_NAME = null;
/*
* --------------------------------------------------------------------------------------------------------------------------------
* 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.
}
/*
* --------------------------------------------------------------------------------------------------------------------------------
* 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.
}
}

View file

@ -1,5 +1,3 @@
package org.eclipse.rse.internal.useractions.files.uda;
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
@ -8,8 +6,12 @@ package org.eclipse.rse.internal.useractions.files.uda;
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * 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.files.uda;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
@ -19,11 +21,11 @@ import java.util.Vector;
import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
import org.eclipse.rse.internal.useractions.ui.uda.ISystemUDTypeEditPaneTypesSelector; import org.eclipse.rse.internal.useractions.ui.uda.ISystemUDTypeEditPaneTypesSelector;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.messages.ISystemMessageLine;
@ -244,7 +246,7 @@ public class UDTypesEditorFiles implements ISystemUDTypeEditPaneTypesSelector, I
*/ */
public SystemMessage validate() { public SystemMessage validate() {
if (typesSelectionList == null) return null; if (typesSelectionList == null) return null;
if (!areTypesSelected()) return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_EMPTY); if (!areTypesSelected()) return RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTTYPES_EMPTY);
// validate that user-defined entry field! // validate that user-defined entry field!
return validateUserDefinedTypes(); return validateUserDefinedTypes();
} }
@ -262,7 +264,7 @@ public class UDTypesEditorFiles implements ISystemUDTypeEditPaneTypesSelector, I
if (index == filename.length() - 1) { if (index == filename.length() - 1) {
if (index == 0 || (index == 1 && filename.charAt(0) == '*')) { if (index == 0 || (index == 1 && filename.charAt(0) == '*')) {
//setErrorMessage(GenericMessages.getString("FileExtension.extensionEmptyMessage")); //$NON-NLS-1$ //setErrorMessage(GenericMessages.getString("FileExtension.extensionEmptyMessage")); //$NON-NLS-1$
return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_NOTVALID); return RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTTYPES_NOTVALID);
} }
} }
int startScan = 0; int startScan = 0;
@ -275,11 +277,11 @@ public class UDTypesEditorFiles implements ISystemUDTypeEditPaneTypesSelector, I
if (index > -1) { if (index > -1) {
if (filename.length() == 1) { if (filename.length() == 1) {
//setErrorMessage(GenericMessages.getString("FileExtension.extensionEmptyMessage")); //$NON-NLS-1$ //setErrorMessage(GenericMessages.getString("FileExtension.extensionEmptyMessage")); //$NON-NLS-1$
return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_NOTVALID); return RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTTYPES_NOTVALID);
} }
if (index != 0 || filename.charAt(1) != '.') { if (index != 0 || filename.charAt(1) != '.') {
//setErrorMessage(GenericMessages.getString("FileExtension.fileNameInvalidMessage")); //$NON-NLS-1$ //setErrorMessage(GenericMessages.getString("FileExtension.fileNameInvalidMessage")); //$NON-NLS-1$
return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTTYPES_NOTVALID); return RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTTYPES_NOTVALID);
} }
} }
return null; return null;

View file

@ -6,8 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * 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 * 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; package org.eclipse.rse.internal.useractions.ui.compile;
@ -19,7 +20,8 @@ import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.internal.ui.GenericMessages; import org.eclipse.rse.internal.ui.GenericMessages;
import org.eclipse.rse.internal.ui.view.SystemTableViewProvider; 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.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseAction; import org.eclipse.rse.ui.actions.SystemBaseAction;
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject; import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
@ -43,7 +45,7 @@ public class SystemCompileAction extends SystemBaseAction {
*/ */
public SystemCompileAction(Shell shell, SystemCompileCommand compileCommand, boolean isPrompt) { public SystemCompileAction(Shell shell, SystemCompileCommand compileCommand, boolean isPrompt) {
super( 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.compileCmd = compileCommand;
this.isPrompt = isPrompt; this.isPrompt = isPrompt;
SystemCompileManager mgr = compileCommand.getParentType().getParentProfile().getParentManager(); SystemCompileManager mgr = compileCommand.getParentType().getParentProfile().getParentManager();

View file

@ -6,8 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * 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 * 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; package org.eclipse.rse.internal.useractions.ui.compile;

View file

@ -8,7 +8,9 @@ package org.eclipse.rse.internal.useractions.ui.compile;
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/ *******************************************************************************/
import java.util.Vector; import java.util.Vector;
@ -18,13 +20,13 @@ import org.eclipse.rse.internal.useractions.ui.SystemCmdSubstVarList;
import org.eclipse.rse.internal.useractions.ui.SystemCommandTextField; import org.eclipse.rse.internal.useractions.ui.SystemCommandTextField;
import org.eclipse.rse.internal.useractions.ui.SystemCommandViewerConfiguration; import org.eclipse.rse.internal.useractions.ui.SystemCommandViewerConfiguration;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; 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.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.shells.ui.view.ISystemCommandTextModifyListener; import org.eclipse.rse.shells.ui.view.ISystemCommandTextModifyListener;
import org.eclipse.rse.ui.ISystemMassager; import org.eclipse.rse.ui.ISystemMassager;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.validators.ISystemValidator; import org.eclipse.rse.ui.validators.ISystemValidator;
import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString; import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString;
import org.eclipse.rse.ui.validators.ValidatorCompileCommandLabel;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;

View file

@ -8,11 +8,14 @@ package org.eclipse.rse.internal.useractions.ui.compile;
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/ *******************************************************************************/
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.rse.ui.ISystemIconConstants; import org.eclipse.rse.internal.useractions.Activator;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.internal.useractions.IUserActionsImageIds;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
/** /**
@ -20,6 +23,9 @@ import org.eclipse.swt.graphics.Image;
* dialog. * dialog.
*/ */
public class SystemCompileCommandLabelProvider extends LabelProvider { public class SystemCompileCommandLabelProvider extends LabelProvider {
Image _compileCommandImage = null;
/** /**
* Constructor * Constructor
*/ */
@ -27,8 +33,8 @@ public class SystemCompileCommandLabelProvider extends LabelProvider {
super(); super();
} }
/** /* (non-Javadoc)
* Override of parent to return the visual label for the given compile command * @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
*/ */
public String getText(Object element) { public String getText(Object element) {
if (element instanceof SystemCompileCommand) if (element instanceof SystemCompileCommand)
@ -39,11 +45,19 @@ public class SystemCompileCommandLabelProvider extends LabelProvider {
return null; return null;
} }
/** /* (non-Javadoc)
* Override of parent so we can supply an image, if we desire. * @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
*/ */
public Image getImage(Object element) { public Image getImage(Object element) {
if (element instanceof SystemCompileCommand) return RSEUIPlugin.getDefault().getImage(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID); Image result = null;
return 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;
} }
} }

View file

@ -6,9 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * 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) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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; package org.eclipse.rse.internal.useractions.ui.compile;
@ -18,11 +19,11 @@ import java.util.Hashtable;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.RSECorePlugin; 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.IHost;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.SystemStartHere; import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; 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.SystemCmdSubstVarList;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
@ -210,7 +211,7 @@ public abstract class SystemCompileManager {
} }
//System.out.println("systemProfile = " + systemProfile); //System.out.println("systemProfile = " + systemProfile);
//System.out.println("subsystemFactory = " + subsystemFactory); //System.out.println("subsystemFactory = " + subsystemFactory);
IFolder folder = SystemResourceManager.getCompileCommandsFolder(systemProfile, subsystemFactory); IFolder folder = UserActionsPersistenceUtil.getCompileCommandsFolder(systemProfile, subsystemFactory);
return folder; return folder;
} }

View file

@ -8,6 +8,8 @@
* Contributors: * 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 * 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
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.compile; package org.eclipse.rse.internal.useractions.ui.compile;
@ -17,10 +19,10 @@ import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode; 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.compile.teamview.SystemTeamViewCompileTypeNode;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction; import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter; import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
@ -39,7 +41,7 @@ public class SystemWorkWithCompileCommandsAction extends SystemBaseDialogAction
public SystemWorkWithCompileCommandsAction(Shell shell, boolean fromCascadingCompileAction) { public SystemWorkWithCompileCommandsAction(Shell shell, boolean fromCascadingCompileAction) {
super(fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWCOMPILE_CMDS_LABEL : SystemUDAResources.ACTION_WORKWITH_COMPILE_CMDS_LABEL, 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() 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); allowOnMultipleSelection(false);
if (!fromCascadingCompileAction) if (!fromCascadingCompileAction)
setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH); setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);

View file

@ -9,6 +9,8 @@
* 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) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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.compile; package org.eclipse.rse.internal.useractions.ui.compile;
@ -28,6 +30,7 @@ import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.events.ISystemModelChangeEvents; import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener; 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.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
@ -585,10 +588,10 @@ public class SystemWorkWithCompileCommandsDialog extends SystemPromptDialog impl
saveCompileCommand(editedCompileCmd, newMode, prevListSelection); saveCompileCommand(editedCompileCmd, newMode, prevListSelection);
processCommandsListSelected(); processCommandsListSelected();
if (newMode) 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); null);
else 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); editedCompileCmd, null);
} }
} }
@ -927,7 +930,7 @@ public class SystemWorkWithCompileCommandsDialog extends SystemPromptDialog impl
rmvSrcTypeButton.setEnabled(true); rmvSrcTypeButton.setEnabled(true);
//traceTest = false; //traceTest = false;
// fire model change event in case any BP code is listening... // 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) { } catch (Exception exc) {
} }
@ -964,7 +967,7 @@ public class SystemWorkWithCompileCommandsDialog extends SystemPromptDialog impl
listView.showSelection(); listView.showSelection();
processCommandsListSelected(); processCommandsListSelected();
// fire model change event in case any BP code is listening... // 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 +1001,7 @@ public class SystemWorkWithCompileCommandsDialog extends SystemPromptDialog impl
listView.showSelection(); listView.showSelection();
processCommandsListSelected(); processCommandsListSelected();
// fire model change event in case any BP code is listening... // 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 +1063,7 @@ public class SystemWorkWithCompileCommandsDialog extends SystemPromptDialog impl
clipboard.dispose(); clipboard.dispose();
clipboard = null; clipboard = null;
// fire model change event in case any BP code is listening... // 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);
} }
/** /**

View file

@ -6,7 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * 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; package org.eclipse.rse.internal.useractions.ui.compile.teamview;
@ -14,8 +16,8 @@ import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.core.model.ISystemProfile; 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.internal.useractions.ui.compile.SystemCompileCommand;
import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
/** /**
@ -49,7 +51,7 @@ public class SystemTeamViewCompileCommandNode implements IAdaptable {
* @return the image to show in the tree, for this node * @return the image to show in the tree, for this node
*/ */
public ImageDescriptor getImageDescriptor() { public ImageDescriptor getImageDescriptor() {
return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_COMPILE_ID); return RSEUIPlugin.getDefault().getImageDescriptor(IUserActionsImageIds.COMPILE_1);
} }
/** /**

View file

@ -9,6 +9,8 @@
* 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) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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; package org.eclipse.rse.internal.useractions.ui.propertypages;
@ -17,6 +19,7 @@ import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.events.ISystemModelChangeEvents; import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents;
import org.eclipse.rse.internal.useractions.UserActionsResources; import org.eclipse.rse.internal.useractions.UserActionsResources;
import org.eclipse.rse.internal.useractions.ui.compile.ISystemCompileCommandEditPaneHoster; 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.ISystemCompileCommandEditPaneListener;
@ -166,7 +169,7 @@ public class SystemTeamViewCompileCommandPropertyPage extends SystemBaseProperty
ok = (editedCompileCmd != null); ok = (editedCompileCmd != null);
if (!ok) return false; if (!ok) return false;
getCompileCommand().getCompileCommand().getParentType().getParentProfile().writeToDisk(); getCompileCommand().getCompileCommand().getParentType().getParentProfile().writeToDisk();
RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, editedCompileCmd, null); RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_COMPILECMD, editedCompileCmd, null);
return ok; return ok;
} }

View file

@ -9,6 +9,8 @@
* 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) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
@ -24,18 +26,19 @@ import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents;
import org.eclipse.rse.internal.useractions.ui.ISystemCommandTextAdditionalGUIProvider; import org.eclipse.rse.internal.useractions.ui.ISystemCommandTextAdditionalGUIProvider;
import org.eclipse.rse.internal.useractions.ui.SystemCmdSubstVarList; import org.eclipse.rse.internal.useractions.ui.SystemCmdSubstVarList;
import org.eclipse.rse.internal.useractions.ui.SystemCommandTextField; import org.eclipse.rse.internal.useractions.ui.SystemCommandTextField;
import org.eclipse.rse.internal.useractions.ui.SystemCommandViewerConfiguration; import org.eclipse.rse.internal.useractions.ui.SystemCommandViewerConfiguration;
import org.eclipse.rse.internal.useractions.ui.validators.ValidatorUserActionComment;
import org.eclipse.rse.internal.useractions.ui.validators.ValidatorUserActionName;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.shells.ui.view.ISystemCommandTextModifyListener; import org.eclipse.rse.shells.ui.view.ISystemCommandTextModifyListener;
import org.eclipse.rse.ui.ISystemMassager; import org.eclipse.rse.ui.ISystemMassager;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.validators.ISystemValidator; import org.eclipse.rse.ui.validators.ISystemValidator;
import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString; import org.eclipse.rse.ui.validators.ISystemValidatorUniqueString;
import org.eclipse.rse.ui.validators.ValidatorUserActionComment;
import org.eclipse.rse.ui.validators.ValidatorUserActionName;
import org.eclipse.rse.ui.widgets.SystemEditPaneStateMachine; import org.eclipse.rse.ui.widgets.SystemEditPaneStateMachine;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusEvent;
@ -1097,9 +1100,9 @@ public class SystemUDActionEditPane implements SelectionListener, // for the che
udam.saveUserData(currentProfile); udam.saveUserData(currentProfile);
// inform anybody registered as listeners that we have created/changed model object... // inform anybody registered as listeners that we have created/changed model object...
if (newMode) if (newMode)
RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION, currentAction, null); RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION, currentAction, null);
else else
RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION, currentAction, null); RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION, currentAction, null);
} }
/** /**

View file

@ -1,5 +1,3 @@
package org.eclipse.rse.internal.useractions.ui.uda;
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
@ -8,17 +6,20 @@ package org.eclipse.rse.internal.useractions.ui.uda;
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user actions API out of org.eclipse.rse.ui
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.uda;
import java.io.File; import java.io.File;
import java.util.Vector; import java.util.Vector;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.UserActionsIcon; import org.eclipse.rse.internal.useractions.UserActionsIcon;
import org.eclipse.rse.internal.useractions.UserActionsPersistenceUtil;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -130,14 +131,14 @@ public class SystemUDActionManager extends SystemUDBaseManager
* for the given profile * for the given profile
*/ */
protected IFolder getDocumentFolder(ISubSystemConfiguration subsystemFactory, ISystemProfile profile) { protected IFolder getDocumentFolder(ISubSystemConfiguration subsystemFactory, ISystemProfile profile) {
return SystemResourceManager.getUserActionsFolder(profile.getName(), subsystemFactory); return UserActionsPersistenceUtil.getUserActionsFolder(profile.getName(), subsystemFactory);
} }
/** /**
* Intended for IMPORT actions only, where no Subsystem instance available: * Intended for IMPORT actions only, where no Subsystem instance available:
*/ */
public void setFolder(String profileName, String factoryId) { public void setFolder(String profileName, String factoryId) {
importCaseFolder = SystemResourceManager.getUserActionsFolder(profileName, factoryId); importCaseFolder = UserActionsPersistenceUtil.getUserActionsFolder(profileName, factoryId);
} }
/** /**
@ -152,7 +153,7 @@ public class SystemUDActionManager extends SystemUDBaseManager
*/ */
public boolean hasActions(ISystemProfile profile, ISubSystemConfiguration ssFactory) { public boolean hasActions(ISystemProfile profile, ISubSystemConfiguration ssFactory) {
boolean hasActions = false; boolean hasActions = false;
boolean folderExists = SystemResourceManager.testUserActionsFolder(profile.getName(), ssFactory); boolean folderExists = UserActionsPersistenceUtil.testUserActionsFolder(profile.getName(), ssFactory);
if (folderExists) { if (folderExists) {
String fileName = getFilePath(profile); String fileName = getFilePath(profile);
if (fileName != null) { if (fileName != null) {

View file

@ -8,14 +8,16 @@
* Contributors: * 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) - [168975] Move RSE Events API to Core
* 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
import org.eclipse.jface.viewers.IBasicPropertyConstants; import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
/** /**
@ -46,7 +48,7 @@ public class SystemUDActionTreeView extends SystemUDBaseTreeView {
* This is a parent class override. * This is a parent class override.
*/ */
protected int getResourceType() { protected int getResourceType() {
return ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION; return IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_USERACTION;
} }
/** /**

View file

@ -9,6 +9,8 @@
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemUDAConstants * Martin Oberhuber (Wind River) - [180562][api] dont implement ISystemUDAConstants
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
@ -50,6 +52,7 @@ import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemIconConstants; import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.ISystemMessages;
@ -422,7 +425,7 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan
// Phil. 08/2002 // Phil. 08/2002
if ((null == docroot) || !docroot.getTagName().equals(getDocumentRootTagName())) { if ((null == docroot) || !docroot.getTagName().equals(getDocumentRootTagName())) {
Shell activeShell = getActiveShell(); Shell activeShell = getActiveShell();
SystemMessage docRootMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_UDA_ROOTTAG_ERROR); SystemMessage docRootMsg = RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_UDA_ROOTTAG_ERROR);
String oldFileName = getFilePath(profile); String oldFileName = getFilePath(profile);
String newFileName = getFileName() + ".bad"; //$NON-NLS-1$ String newFileName = getFileName() + ".bad"; //$NON-NLS-1$
IFile file = getFolder(profile).getFile(getFileName()); IFile file = getFolder(profile).getFile(getFileName());
@ -444,7 +447,7 @@ public abstract class SystemUDBaseManager implements ErrorHandler, IResourceChan
Document doc = initializeDocument(); Document doc = initializeDocument();
SystemMessageDialog msgdlg = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), RSEUIPlugin.getPluginMessage( SystemMessageDialog msgdlg = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), RSEUIPlugin.getPluginMessage(
// ISystemMessages.MSG_RESTORE_FAILED).makeSubstitution(exc)); // ISystemMessages.MSG_RESTORE_FAILED).makeSubstitution(exc));
ISystemMessages.MSG_UDA_LOAD_ERROR).makeSubstitution(fileName, exc)); IUserActionsMessageIds.MSG_UDA_LOAD_ERROR).makeSubstitution(fileName, exc));
msgdlg.open(); msgdlg.open();
return doc; return doc;
} }

View file

@ -9,6 +9,8 @@
* 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) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
@ -29,9 +31,9 @@ import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.view.SystemViewMenuListener; import org.eclipse.rse.internal.ui.view.SystemViewMenuListener;
import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.actions.ISystemAction; import org.eclipse.rse.ui.actions.ISystemAction;
@ -398,7 +400,7 @@ public class SystemUDBaseTreeView extends TreeViewer implements IMenuListener, I
* Return message for delete confirmation * Return message for delete confirmation
*/ */
protected SystemMessage getDeleteConfirmationMessage() { protected SystemMessage getDeleteConfirmationMessage() {
return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONFIRM_DELETE_USERACTION); return RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_CONFIRM_DELETE_USERACTION);
} }
/** /**

View file

@ -8,13 +8,14 @@ package org.eclipse.rse.internal.useractions.ui.uda;
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user actions API out of org.eclipse.rse.ui
*******************************************************************************/ *******************************************************************************/
import org.eclipse.rse.internal.useractions.ui.validators.ValidatorUserTypeTypes;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.messages.ISystemMessageLine; import org.eclipse.rse.ui.messages.ISystemMessageLine;
import org.eclipse.rse.ui.validators.ISystemValidator; import org.eclipse.rse.ui.validators.ISystemValidator;
import org.eclipse.rse.ui.validators.ValidatorUserTypeTypes;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
@ -171,7 +172,7 @@ public class SystemUDSimpleTypesListEditor implements ISystemUDTypeEditPaneTypes
nonEditableVerbage.setVisible(false); nonEditableVerbage.setVisible(false);
else { else {
nonEditableVerbage.setVisible(true); nonEditableVerbage.setVisible(true);
if (vendor.equals("IBM")) if (vendor.equals("IBM")) //$NON-NLS-1$
nonEditableVerbage.setText(SystemUDAResources.RESID_UDT_IBM_VERBAGE); nonEditableVerbage.setText(SystemUDAResources.RESID_UDT_IBM_VERBAGE);
else { else {
String verbage = SystemUDAResources.RESID_UDT_VENDOR_VERBAGE; String verbage = SystemUDAResources.RESID_UDT_VENDOR_VERBAGE;

View file

@ -9,6 +9,8 @@
* 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) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
@ -24,9 +26,10 @@ import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents;
import org.eclipse.rse.internal.useractions.ui.validators.ValidatorUserTypeName;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.SystemWidgetHelpers; import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.validators.ValidatorUserTypeName;
import org.eclipse.rse.ui.widgets.SystemEditPaneStateMachine; import org.eclipse.rse.ui.widgets.SystemEditPaneStateMachine;
import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.ModifyListener;
@ -472,9 +475,9 @@ public class SystemUDTypeEditPane implements ISelectionChangedListener {
udtm.saveUserData(); udtm.saveUserData();
// inform anybody registered as listeners that we have created/changed model object... // inform anybody registered as listeners that we have created/changed model object...
if (newMode) if (newMode)
RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE, currentType, null); RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE, currentType, null);
else else
RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE, currentType, null); RSECorePlugin.getTheSystemRegistry().fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_CHANGED, IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE, currentType, null);
} }
/** /**

View file

@ -6,8 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * 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 * 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
@ -19,10 +20,10 @@ import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.rse.core.SystemResourceHelpers; import org.eclipse.rse.core.SystemResourceHelpers;
import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.UserActionsIcon; import org.eclipse.rse.internal.useractions.UserActionsIcon;
import org.eclipse.rse.internal.useractions.UserActionsPersistenceUtil;
import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -159,7 +160,7 @@ public class SystemUDTypeManager extends SystemUDBaseManager {
*/ */
protected IFolder getDocumentFolder(ISubSystemConfiguration subsystemFactory, ISystemProfile profile) { protected IFolder getDocumentFolder(ISubSystemConfiguration subsystemFactory, ISystemProfile profile) {
// return new location, as of R2 // return new location, as of R2
IFolder typesFolder = SystemResourceManager.getTypeFiltersFolder(subsystemFactory); IFolder typesFolder = UserActionsPersistenceUtil.getTypeFiltersFolder(subsystemFactory);
// we check here for any residual old types files from R1. If found, we move it // we check here for any residual old types files from R1. If found, we move it
// to the new location right away! // to the new location right away!
// TODO: DELETE THIS EXPENSIVE LOGIC AFTER A FEW RELEASES. // TODO: DELETE THIS EXPENSIVE LOGIC AFTER A FEW RELEASES.
@ -167,7 +168,7 @@ public class SystemUDTypeManager extends SystemUDBaseManager {
//if (profile == null) //if (profile == null)
// profile = subsystem.getSystemProfile(); // profile = subsystem.getSystemProfile();
//System.out.println("Is profile null? " + (profile==null)); //System.out.println("Is profile null? " + (profile==null));
IFolder oldFolder = SystemResourceManager.getUserActionsFolder(profile.getName(), subsystemFactory); IFolder oldFolder = UserActionsPersistenceUtil.getUserActionsFolder(profile.getName(), subsystemFactory);
IFile oldFile = oldFolder.getFile(getFileName()); IFile oldFile = oldFolder.getFile(getFileName());
if (exists(oldFile)) { if (exists(oldFile)) {
//System.out.println("Attempt to move old types folder..."); //System.out.println("Attempt to move old types folder...");
@ -209,7 +210,7 @@ public class SystemUDTypeManager extends SystemUDBaseManager {
*/ */
public void setFolder(String profileName, String factoryId) { public void setFolder(String profileName, String factoryId) {
//importCaseFolder = SystemResourceManager.getUserActionsFolder(profileName, factoryId); //importCaseFolder = SystemResourceManager.getUserActionsFolder(profileName, factoryId);
importCaseFolder = SystemResourceManager.getTypeFiltersFolder(factoryId); importCaseFolder = UserActionsPersistenceUtil.getTypeFiltersFolder(factoryId);
} }
/** /**

View file

@ -8,16 +8,18 @@
* Contributors: * 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) - [168975] Move RSE Events API to Core
* 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.uda; package org.eclipse.rse.internal.useractions.ui.uda;
import org.eclipse.jface.viewers.IBasicPropertyConstants; import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.rse.core.events.ISystemModelChangeEvents;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.useractions.IUserActionsMessageIds;
import org.eclipse.rse.internal.useractions.IUserActionsModelChangeEvents;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
@ -72,7 +74,7 @@ public class SystemUDTypeTreeView extends SystemUDBaseTreeView {
* Return message for delete confirmation * Return message for delete confirmation
*/ */
protected SystemMessage getDeleteConfirmationMessage() { protected SystemMessage getDeleteConfirmationMessage() {
return RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONFIRM_DELETE_USERTYPE); return RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_CONFIRM_DELETE_USERTYPE);
} }
/** /**
@ -80,7 +82,7 @@ public class SystemUDTypeTreeView extends SystemUDBaseTreeView {
* This is a parent class override. * This is a parent class override.
*/ */
protected int getResourceType() { protected int getResourceType() {
return ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE; return IUserActionsModelChangeEvents.SYSTEM_RESOURCETYPE_NAMEDTYPE;
} }
/** /**

View file

@ -9,16 +9,18 @@ package org.eclipse.rse.internal.useractions.ui.uda.actions;
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/ *******************************************************************************/
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode; import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode;
import org.eclipse.rse.internal.useractions.IUserActionsImageIds;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.internal.useractions.ui.uda.SystemWorkWithUDTypeDialog; import org.eclipse.rse.internal.useractions.ui.uda.SystemWorkWithUDTypeDialog;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction; import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
@ -70,7 +72,7 @@ public class SystemWorkWithFileTypesAction extends SystemBaseDialogAction {
*/ */
public SystemWorkWithFileTypesAction(Shell parent) { public SystemWorkWithFileTypesAction(Shell parent) {
super(SystemUDAResources.ACTION_WORKWITH_NAMEDTYPES_LABEL, SystemUDAResources.ACTION_WORKWITH_NAMEDTYPES_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor( super(SystemUDAResources.ACTION_WORKWITH_NAMEDTYPES_LABEL, SystemUDAResources.ACTION_WORKWITH_NAMEDTYPES_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor(
ISystemIconConstants.ICON_SYSTEM_WORKWITHNAMEDTYPES_ID), parent); IUserActionsImageIds.WORK_WITH_NAMED_TYPES_1), parent);
allowOnMultipleSelection(false); allowOnMultipleSelection(false);
setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH); setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);
setHelp(RSEUIPlugin.HELPPREFIX + "actn0046"); //$NON-NLS-1$ setHelp(RSEUIPlugin.HELPPREFIX + "actn0046"); //$NON-NLS-1$

View file

@ -9,6 +9,8 @@ package org.eclipse.rse.internal.useractions.ui.uda.actions;
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
*******************************************************************************/ *******************************************************************************/
//import java.util.Iterator; //import java.util.Iterator;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
@ -17,10 +19,10 @@ import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode; import org.eclipse.rse.internal.ui.view.team.SystemTeamViewSubSystemConfigurationNode;
import org.eclipse.rse.internal.useractions.IUserActionsImageIds;
import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources; import org.eclipse.rse.internal.useractions.ui.uda.SystemUDAResources;
import org.eclipse.rse.internal.useractions.ui.uda.SystemWorkWithUDAsDialog; import org.eclipse.rse.internal.useractions.ui.uda.SystemWorkWithUDAsDialog;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction; import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
@ -61,7 +63,7 @@ public class SystemWorkWithUDAsAction extends SystemBaseDialogAction {
*/ */
public SystemWorkWithUDAsAction(Shell parent) { public SystemWorkWithUDAsAction(Shell parent) {
super(SystemUDAResources.ACTION_WORKWITH_UDAS_LABEL, SystemUDAResources.ACTION_WORKWITH_UDAS_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor( super(SystemUDAResources.ACTION_WORKWITH_UDAS_LABEL, SystemUDAResources.ACTION_WORKWITH_UDAS_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor(
ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID), parent); IUserActionsImageIds.WORK_WITH_USER_ACTIONS_1), parent);
allowOnMultipleSelection(false); allowOnMultipleSelection(false);
setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH); setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);
setHelp(RSEUIPlugin.HELPPREFIX + "actn0045"); //$NON-NLS-1$ setHelp(RSEUIPlugin.HELPPREFIX + "actn0045"); //$NON-NLS-1$
@ -76,7 +78,7 @@ public class SystemWorkWithUDAsAction extends SystemBaseDialogAction {
public SystemWorkWithUDAsAction(Shell parent, boolean fromCascadingCompileAction) { public SystemWorkWithUDAsAction(Shell parent, boolean fromCascadingCompileAction) {
super(fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWUDAS_LABEL : SystemUDAResources.ACTION_WORKWITH_UDAS_LABEL, super(fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWUDAS_LABEL : SystemUDAResources.ACTION_WORKWITH_UDAS_LABEL,
fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWUDAS_TOOLTIP : SystemUDAResources.ACTION_WORKWITH_UDAS_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor( fromCascadingCompileAction ? SystemUDAResources.ACTION_WORKWITH_WWUDAS_TOOLTIP : SystemUDAResources.ACTION_WORKWITH_UDAS_TOOLTIP, RSEUIPlugin.getDefault().getImageDescriptor(
ISystemIconConstants.ICON_SYSTEM_WORKWITHUSERACTIONS_ID), parent); IUserActionsImageIds.WORK_WITH_USER_ACTIONS_1), parent);
allowOnMultipleSelection(false); allowOnMultipleSelection(false);
if (!fromCascadingCompileAction) if (!fromCascadingCompileAction)
setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH); setContextMenuGroup(ISystemContextMenuConstants.GROUP_WORKWITH);

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,74 +11,72 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.validators; package org.eclipse.rse.internal.useractions.ui.validators;
import java.util.Collection; import java.util.Collection;
import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin; 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.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; 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 * This class is used to verify a user defined compile command's label
*/ */
public class ValidatorCompileCommandLabel extends ValidatorUniqueString public class ValidatorCompileCommandLabel extends ValidatorUniqueString implements ISystemValidator {
implements ISystemValidator
{
public static final int MAX_CMDLABEL_LENGTH = 50; // max name for a compile command name public static final int MAX_CMDLABEL_LENGTH = 50; // max name for a compile command name
protected boolean fUnique; protected boolean fUnique;
protected SystemMessage msg_Invalid; protected SystemMessage msg_Invalid;
protected IWorkspace workspace = ResourcesPlugin.getWorkspace(); protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
/** /**
* Use this constructor when you have a list of existing labels. * Use this constructor when you have a list of existing labels.
* The collection will not be modified by the validator. * The collection will not be modified by the validator.
*/ */
public ValidatorCompileCommandLabel(Collection existingLabelList) public ValidatorCompileCommandLabel(Collection existingLabelList) {
{
super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
init(); init();
} }
/** /**
* Use this constructor when you have an array of existing labels. * Use this constructor when you have an array of existing labels.
*/ */
public ValidatorCompileCommandLabel(String existingLabelList[]) public ValidatorCompileCommandLabel(String existingLabelList[]) {
{
super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness super(existingLabelList, CASE_INSENSITIVE); // case insensitive uniqueness
init(); init();
} }
/** /**
* Use this constructor when the name need not be unique, and you just want * Use this constructor when the name need not be unique, and you just want
* the syntax checking. Or if you will call setExistingNamesList later. * the syntax checking. Or if you will call setExistingNamesList later.
*/ */
public ValidatorCompileCommandLabel() public ValidatorCompileCommandLabel() {
{
super(new String[0], CASE_INSENSITIVE); super(new String[0], CASE_INSENSITIVE);
init(); init();
} }
private void init() private void init() {
{ super.setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_COMPILELABEL_EMPTY), RSEUIPlugin
super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_EMPTY), .getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_COMPILELABEL_NOTUNIQUE));
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_NOTUNIQUE));
fUnique = true; fUnique = true;
msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_COMPILELABEL_NOTVALID); msg_Invalid = RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_COMPILELABEL_NOTVALID);
} }
/** /**
* Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used. * 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_Empty error message when entry field is empty
* @param msg_NonUnique error message when value entered is not unique * @param msg_NonUnique error message when value entered is not unique
* @param msg_Invalid error message when syntax is not valid * @param msg_Invalid error message when syntax is not valid
*/ */
public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) {
{
super.setErrorMessages(msg_Empty, msg_NonUnique); super.setErrorMessages(msg_Empty, msg_NonUnique);
this.msg_Invalid = msg_Invalid; this.msg_Invalid = msg_Invalid;
} }
@ -87,46 +85,40 @@ public class ValidatorCompileCommandLabel extends ValidatorUniqueString
* Overridable method for invalidate character check, beyond what this class offers * Overridable method for invalidate character check, beyond what this class offers
* @return true if valid, false if not * @return true if valid, false if not
*/ */
protected boolean checkForBadCharacters(String newText) protected boolean checkForBadCharacters(String newText) {
{
return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character. return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character.
(newText.indexOf('@') == -1)); // defect 43950 (newText.indexOf('@') == -1)); // defect 43950
} }
public String toString() public String toString() {
{
return getClass().getName(); return getClass().getName();
} }
// --------------------------- // ---------------------------
// Parent Overrides... // Parent Overrides...
// --------------------------- // ---------------------------
/** /**
* Validate each character. * Validate each character.
* Override of parent method. * Override of parent method.
* Override yourself to refine the error checking. * Override yourself to refine the error checking.
*/ */
public SystemMessage isSyntaxOk(String newText) public SystemMessage isSyntaxOk(String newText) {
{ if (newText.length() > getMaximumNameLength())
if (newText.length() > getMaximumNameLength()) currentMessage = msg_Invalid;
currentMessage = msg_Invalid; else
else currentMessage = checkForBadCharacters(newText) ? null : msg_Invalid;
currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid; return currentMessage;
return currentMessage;
} }
// ---------------------------
// ISystemValidator methods...
// ---------------------------
// --------------------------- /**
// ISystemValidator methods... * Return the max length for compile commands: 50
// --------------------------- */
public int getMaximumNameLength() {
/** return MAX_CMDLABEL_LENGTH;
* Return the max length for compile commands: 50 }
*/
public int getMaximumNameLength()
{
return MAX_CMDLABEL_LENGTH;
}
} }

View file

@ -0,0 +1,107 @@
/********************************************************************************
* Copyright (c) 2002, 2007 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:
* 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.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 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(IUserActionsMessageIds.MSG_VALIDATE_UDACMD_EMPTY), RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.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:
* <pre><code>
* if (isValid(text) != null)
* msg = getSystemMessage();
* </code></pre>
*/
public SystemMessage validate(String text) {
if (isValid(text) != null)
return currentMessage;
else
return null;
}
}

View file

@ -0,0 +1,107 @@
/********************************************************************************
* Copyright (c) 2002, 2007 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:
* 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.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:
* <pre><code>
* if (isValid(text) != null)
* msg = getSystemMessage();
* </code></pre>
*/
public SystemMessage validate(String text) {
if (isValid(text) != null)
return currentMessage;
else
return null;
}
}

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,29 +11,30 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.validators; package org.eclipse.rse.internal.useractions.ui.validators;
import java.util.Collection; import java.util.Collection;
import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin; 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.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; 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. * This class is used to verify a user defined action's name.
*/ */
public class ValidatorUserActionName extends ValidatorUniqueString public class ValidatorUserActionName extends ValidatorUniqueString implements ISystemValidator {
implements ISystemValidator
{
public static final int MAX_UDANAME_LENGTH = 256; // max name for an action public static final int MAX_UDANAME_LENGTH = 256; // max name for an action
protected boolean fUnique; protected boolean fUnique;
protected SystemMessage msg_Invalid; protected SystemMessage msg_Invalid;
protected IWorkspace workspace = ResourcesPlugin.getWorkspace(); protected IWorkspace workspace = ResourcesPlugin.getWorkspace();
/** /**
@ -41,46 +42,42 @@ public class ValidatorUserActionName extends ValidatorUniqueString
* @param existingNameList a collection of existing names to compare against. * @param existingNameList a collection of existing names to compare against.
* The collection will not be modified by the validator. * The collection will not be modified by the validator.
*/ */
public ValidatorUserActionName(Collection existingNameList) public ValidatorUserActionName(Collection existingNameList) {
{
super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
init(); init();
} }
/** /**
* Use this constructor when the name must be unique. Give the * Use this constructor when the name must be unique. Give the
* ctor a string array of existing names to compare against. * ctor a string array of existing names to compare against.
*/ */
public ValidatorUserActionName(String existingNameList[]) public ValidatorUserActionName(String existingNameList[]) {
{
super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness super(existingNameList, CASE_SENSITIVE); // case sensitive uniqueness
init(); init();
} }
/** /**
* Use this constructor when the name need not be unique, and you just want * Use this constructor when the name need not be unique, and you just want
* the syntax checking. * the syntax checking.
*/ */
public ValidatorUserActionName() public ValidatorUserActionName() {
{
super(new String[0], CASE_SENSITIVE); super(new String[0], CASE_SENSITIVE);
init(); init();
} }
private void init() private void init() {
{ super.setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDANAME_EMPTY), RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDANAME_NOTUNIQUE));
super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_EMPTY),
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_NOTUNIQUE));
fUnique = true; fUnique = true;
msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDANAME_NOTVALID); msg_Invalid = RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDANAME_NOTVALID);
} }
/** /**
* Supply your own error message text. By default, messages from RSEUIPlugin resource bundle are used. * 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_Empty error message when entry field is empty
* @param msg_NonUnique error message when value entered is not unique * @param msg_NonUnique error message when value entered is not unique
* @param msg_Invalid error message when syntax is not valid * @param msg_Invalid error message when syntax is not valid
*/ */
public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) {
{
super.setErrorMessages(msg_Empty, msg_NonUnique); super.setErrorMessages(msg_Empty, msg_NonUnique);
this.msg_Invalid = msg_Invalid; this.msg_Invalid = msg_Invalid;
} }
@ -89,46 +86,40 @@ public class ValidatorUserActionName extends ValidatorUniqueString
* Overridable method for invalidate character check, beyond what this class offers * Overridable method for invalidate character check, beyond what this class offers
* @return true if valid, false if not * @return true if valid, false if not
*/ */
protected boolean checkForBadCharacters(String newText) protected boolean checkForBadCharacters(String newText) {
{
return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character return ((newText.indexOf('&') == -1) && // causes problems in menu popup as its a mnemonic character
(newText.indexOf('@') == -1)); // defect 43950 (newText.indexOf('@') == -1)); // defect 43950
} }
public String toString() public String toString() {
{
return "UserActionNameValidator class"; //$NON-NLS-1$ return "UserActionNameValidator class"; //$NON-NLS-1$
} }
// --------------------------- // ---------------------------
// Parent Overrides... // Parent Overrides...
// --------------------------- // ---------------------------
/** /**
* Validate each character. * Validate each character.
* Override of parent method. * Override of parent method.
* Override yourself to refine the error checking. * Override yourself to refine the error checking.
*/ */
public SystemMessage isSyntaxOk(String newText) public SystemMessage isSyntaxOk(String newText) {
{ if (newText.length() > getMaximumNameLength())
if (newText.length() > getMaximumNameLength()) currentMessage = msg_Invalid;
currentMessage = msg_Invalid; else
else currentMessage = checkForBadCharacters(newText) ? null : msg_Invalid;
currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid; return currentMessage;
return currentMessage;
} }
// ---------------------------
// ISystemValidator methods...
// ---------------------------
// --------------------------- /**
// ISystemValidator methods... * Return the max length for folder names: 256
// --------------------------- */
public int getMaximumNameLength() {
/** return MAX_UDANAME_LENGTH;
* Return the max length for folder names: 256 }
*/
public int getMaximumNameLength()
{
return MAX_UDANAME_LENGTH;
}
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,21 +11,22 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * David Dykstal (IBM) - [186589] move user types, user actions, and compile commands
* API to the user actions plugin
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.validators; package org.eclipse.rse.internal.useractions.ui.validators;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin;
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 type's name. * This class is used to verify a user defined type's name.
*/ */
public class ValidatorUserTypeName extends ValidatorUniqueString public class ValidatorUserTypeName extends ValidatorUniqueString implements ISystemValidator {
implements ISystemValidator
{
public static final int MAX_UDTNAME_LENGTH = 50; // max name for a file type public static final int MAX_UDTNAME_LENGTH = 50; // max name for a file type
protected SystemMessage msg_Invalid; protected SystemMessage msg_Invalid;
@ -33,17 +34,14 @@ public class ValidatorUserTypeName extends ValidatorUniqueString
/** /**
* Use this constructor when the name need not be unique, and you just want the syntax checking. * Use this constructor when the name need not be unique, and you just want the syntax checking.
*/ */
public ValidatorUserTypeName() public ValidatorUserTypeName() {
{
super(new String[0], CASE_INSENSITIVE); super(new String[0], CASE_INSENSITIVE);
init(); init();
} }
private void init() private void init() {
{ super.setErrorMessages(RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTNAME_EMPTY), RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTNAME_NOTUNIQUE));
super.setErrorMessages(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_EMPTY), msg_Invalid = RSEUIPlugin.getPluginMessage(IUserActionsMessageIds.MSG_VALIDATE_UDTNAME_NOTVALID);
RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_NOTUNIQUE));
msg_Invalid = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_VALIDATE_UDTNAME_NOTVALID);
} }
/** /**
@ -52,8 +50,7 @@ public class ValidatorUserTypeName extends ValidatorUniqueString
* @param msg_NonUnique error message when value entered is not unique * @param msg_NonUnique error message when value entered is not unique
* @param msg_Invalid error message when syntax is not valid * @param msg_Invalid error message when syntax is not valid
*/ */
public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) public void setErrorMessages(SystemMessage msg_Empty, SystemMessage msg_NonUnique, SystemMessage msg_Invalid) {
{
super.setErrorMessages(msg_Empty, msg_NonUnique); super.setErrorMessages(msg_Empty, msg_NonUnique);
this.msg_Invalid = msg_Invalid; this.msg_Invalid = msg_Invalid;
} }
@ -62,45 +59,39 @@ public class ValidatorUserTypeName extends ValidatorUniqueString
* Overridable method for invalidate character check, beyond what this class offers * Overridable method for invalidate character check, beyond what this class offers
* @return true if valid, false if not * @return true if valid, false if not
*/ */
protected boolean checkForBadCharacters(String newText) protected boolean checkForBadCharacters(String newText) {
{
return true; return true;
} }
public String toString() public String toString() {
{
return "UserTypeNameValidator class"; //$NON-NLS-1$ return "UserTypeNameValidator class"; //$NON-NLS-1$
} }
// --------------------------- // ---------------------------
// Parent Overrides... // Parent Overrides...
// --------------------------- // ---------------------------
/** /**
* Validate each character. * Validate each character.
* Override of parent method. * Override of parent method.
* Override yourself to refine the error checking. * Override yourself to refine the error checking.
*/ */
public SystemMessage isSyntaxOk(String newText) public SystemMessage isSyntaxOk(String newText) {
{ if (newText.length() > getMaximumNameLength())
if (newText.length() > getMaximumNameLength()) currentMessage = msg_Invalid;
currentMessage = msg_Invalid; else
else currentMessage = checkForBadCharacters(newText) ? null : msg_Invalid;
currentMessage = checkForBadCharacters(newText) ? null: msg_Invalid; return currentMessage;
return currentMessage;
} }
// ---------------------------
// ISystemValidator methods...
// ---------------------------
// --------------------------- /**
// ISystemValidator methods... * Return the max length for folder names: 50
// --------------------------- */
public int getMaximumNameLength() {
/** return MAX_UDTNAME_LENGTH;
* Return the max length for folder names: 50 }
*/
public int getMaximumNameLength()
{
return MAX_UDTNAME_LENGTH;
}
} }

View file

@ -0,0 +1,107 @@
/********************************************************************************
* Copyright (c) 2002, 2007 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:
* 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.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:
* <pre><code>
* if (isValid(text) != null)
* msg = getSystemMessage();
* </code></pre>
*/
public SystemMessage validate(String text) {
if (isValid(text) != null)
return currentMessage;
else
return null;
}
}