diff --git a/rse/plugins/org.eclipse.rse.ui/HelpContexts.xml b/rse/plugins/org.eclipse.rse.ui/HelpContexts.xml index fd29d4369e5..b13a7e04594 100644 --- a/rse/plugins/org.eclipse.rse.ui/HelpContexts.xml +++ b/rse/plugins/org.eclipse.rse.ui/HelpContexts.xml @@ -914,5 +914,11 @@ You can specify what severity of messages you wish to log - from informational m Messages are logged to the .log file in the .metadata folder of the workspace. + + This action imports connection definitions that have been exported from another workbench. A file selection dialog is displayed, and the specified file containing the connection definitions is imported. New connections will appear in the workspace. If a connection by that name already exists in the workspace, the connection being imported will be renamed. + + + This action exports connection definitions to a file. A file selection dialog is displayed, and you specify the directory and file name into which to export the selected connections and their filters. You may then import the connections into another workbench using the import action. + - \ No newline at end of file + diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.java index 8e36ec7bd2c..1340e91cc1c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.java @@ -985,6 +985,10 @@ public class SystemResources extends NLS public static String RESID_DO_NOT_SHOW_MESSAGE_AGAIN_LABEL; public static String RESID_DO_NOT_SHOW_MESSAGE_AGAIN_TOOLTIP; + public static String RESID_EXPORT_CONNECTION_ACTIONS_TOOLTIP; + + public static String RESID_EXPORT_CONNECTIONS_ACTION_LABEL; + // Encoding public static String RESID_HOST_ENCODING_GROUP_LABEL; public static String RESID_HOST_ENCODING_SETTING_NOTE; @@ -995,6 +999,14 @@ public class SystemResources extends NLS public static String RESID_HOST_ENCODING_OTHER_LABEL; public static String RESID_HOST_ENCODING_OTHER_TOOLTIP; public static String RESID_HOST_ENCODING_ENTER_TOOLTIP; + + public static String RESID_IMPORT_CONNECTION_ACTION_INVALID_FORMAT; + + public static String RESID_IMPORT_CONNECTION_ACTION_LABEL; + + public static String RESID_IMPORT_CONNECTION_ACTION_READER_MISSING; + + public static String RESID_IMPORT_CONNECTION_ACTION_TOOLTIP; static { // load message values from bundle file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.properties b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.properties index 01ec2181db1..14c4f17d196 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.properties +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/SystemResources.properties @@ -1053,6 +1053,8 @@ RESID_SERVICESFORM_PROPERTIES_TOOLTIP=Edit the properties of the item selected i ## Do not show this message again RESID_DO_NOT_SHOW_MESSAGE_AGAIN_LABEL = Do not show this message again RESID_DO_NOT_SHOW_MESSAGE_AGAIN_TOOLTIP = Select this option if you do not want to see this message again +RESID_EXPORT_CONNECTION_ACTIONS_TOOLTIP=Export connection definitions +RESID_EXPORT_CONNECTIONS_ACTION_LABEL=Export... # Strings for Encodings RESID_HOST_ENCODING_GROUP_LABEL=Default encoding @@ -1064,3 +1066,7 @@ RESID_HOST_ENCODING_REMOTE_TOOLTIP=The default encoding of the platform obtained RESID_HOST_ENCODING_OTHER_LABEL=Other: RESID_HOST_ENCODING_OTHER_TOOLTIP=Specify a different encoding RESID_HOST_ENCODING_ENTER_TOOLTIP=Select or enter an encoding +RESID_IMPORT_CONNECTION_ACTION_INVALID_FORMAT=The selected file is not of the correct format to be imported. +RESID_IMPORT_CONNECTION_ACTION_LABEL=Import... +RESID_IMPORT_CONNECTION_ACTION_READER_MISSING=The reader for this file format is not installed. +RESID_IMPORT_CONNECTION_ACTION_TOOLTIP=Import connection definitions diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemExportConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemExportConnectionAction.java new file mode 100644 index 00000000000..a807b7147e5 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemExportConnectionAction.java @@ -0,0 +1,45 @@ +/******************************************************************************** + * Copyright (c) 2008 IBM Corporation and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - [216858] provide ability to import and export connections + ********************************************************************************/ + +package org.eclipse.rse.internal.ui.actions; + +import org.eclipse.rse.internal.ui.SystemResources; +import org.eclipse.rse.ui.ISystemContextMenuConstants; +import org.eclipse.rse.ui.RSEUIPlugin; +import org.eclipse.rse.ui.actions.SystemBaseAction; + +/** + * This is the action for clearing in-memory userId and password cache + */ +public class SystemExportConnectionAction extends SystemBaseAction { + + /** + * Constructor. + */ + public SystemExportConnectionAction() { + super(SystemResources.RESID_EXPORT_CONNECTIONS_ACTION_LABEL, SystemResources.RESID_EXPORT_CONNECTION_ACTIONS_TOOLTIP, null); + setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION); + setHelp(RSEUIPlugin.HELPPREFIX + "ActionExportConnectionDefinitions"); //$NON-NLS-1$ + } + + /** + * The export password action is enabled when the selection contains only connections (hosts) + */ + public boolean checkObjectType(Object obj) { + return true; + } + + /** + * Called when this action is selection from the popup menu. + */ + public void run() { + // TODO DWD implement + } +} \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemImportConnectionAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemImportConnectionAction.java new file mode 100644 index 00000000000..6f1f1662793 --- /dev/null +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/actions/SystemImportConnectionAction.java @@ -0,0 +1,54 @@ +/******************************************************************************** + * Copyright (c) 2008 IBM Corporation and others. All rights reserved. + * This program and the accompanying materials are made available under the terms + * of the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * David Dykstal (IBM) - [216858] provide ability to import and export connections + ********************************************************************************/ + +package org.eclipse.rse.internal.ui.actions; + +import org.eclipse.core.runtime.IStatus; +import org.eclipse.rse.internal.ui.SystemResources; +import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage; +import org.eclipse.rse.ui.ISystemContextMenuConstants; +import org.eclipse.rse.ui.RSEUIPlugin; +import org.eclipse.rse.ui.actions.SystemBaseAction; + +/** + * This action is used to import a connection from its package file into the default profile. + */ +public class SystemImportConnectionAction extends SystemBaseAction { + + private static final SimpleSystemMessage error1 = new SimpleSystemMessage(RSEUIPlugin.PLUGIN_ID, IStatus.ERROR, SystemResources.RESID_IMPORT_CONNECTION_ACTION_INVALID_FORMAT); + private static final SimpleSystemMessage error2 = new SimpleSystemMessage(RSEUIPlugin.PLUGIN_ID, IStatus.ERROR, SystemResources.RESID_IMPORT_CONNECTION_ACTION_READER_MISSING); + + /** + * Creates a new action to import a connection into a profile. + */ + public SystemImportConnectionAction() { + super(SystemResources.RESID_IMPORT_CONNECTION_ACTION_LABEL, SystemResources.RESID_IMPORT_CONNECTION_ACTION_TOOLTIP, null); + setContextMenuGroup(ISystemContextMenuConstants.GROUP_CONNECTION); + setHelp(RSEUIPlugin.HELPPREFIX + "ActionImportConnectionDefinitions"); //$NON-NLS-1$ + } + + /** + * The import action can be run no matter what the selection is. + * @return true + */ + public boolean checkObjectType(Object obj) { + return true; + } + + /** + * Called when this action is selection from the popup menu. + */ + public void run() { + // TODO DWD implement + } + + + +} \ No newline at end of file