From 21dabe663f8d826044d76be2d1fa8f26c21606fd Mon Sep 17 00:00:00 2001 From: Tobias Schwarz Date: Tue, 7 Jan 2014 14:09:12 +0100 Subject: Target Explorer: replace the term 'target' with 'configuration' --- .../org.eclipse.tcf.te.tcf.ui/plugin.properties | 16 +++--- .../org/eclipse/tcf/te/tcf/ui/nls/Messages.java | 1 - .../eclipse/tcf/te/tcf/ui/nls/Messages.properties | 59 +++++++++++----------- .../tcf/te/tcf/ui/wizards/NewTargetWizard.java | 35 +++++++++++++ .../ui/wizards/pages/AbstractConfigWizardPage.java | 20 +++++--- .../tcf/ui/wizards/pages/NewTargetWizardPage.java | 9 ++++ .../eclipse/tcf/te/ui/wizards/AbstractWizard.java | 30 +++++++++++ 7 files changed, 124 insertions(+), 46 deletions(-) diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties index fdf232507..a55124653 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/plugin.properties @@ -23,12 +23,12 @@ PeersByCurrentUserFilter.name=Only show targets started by me # ***** Import/Export Wizards ***** ImportWizards.Category.TCF=System Management -ImportWizards.Peer=Targets -ImportWizards.PeerDescription=Import targets into the System Management view. +ImportWizards.Peer=Configurations +ImportWizards.PeerDescription=Import configurations into the System Management view. ExportWizards.Category.TCF=System Management -ExportWizards.Peer=Targets -ExportWizards.PeerDescription=Export targets from the System Management view. +ExportWizards.Peer=Configurations +ExportWizards.PeerDescription=Export configurations from the System Management view. # ***** Decorators ***** @@ -38,7 +38,7 @@ peerhost.decorator.label = Target Node Decorator NewWizards.category.name=Target Communication Framework -NewTargetWizard.name=Target +NewTargetWizard.name=Configuration NewTargetWizard.description=Specify the attributes of the target to connect to. # ***** Editor Pages ***** @@ -58,15 +58,15 @@ preference.page.name = Logging ToolbarAction.label=Target Connections command.delete.label=Delete -command.delete.tooltip=Delete the selected target +command.delete.tooltip=Delete the selected configuration command.delete.mnemonic = D command.rename.label=Rename -command.rename.tooltip=Rename the selected target +command.rename.tooltip=Rename the selected configuration command.rename.mnemonic = R command.refresh.label=Refresh -command.refresh.tooltip=Refresh the selected target +command.refresh.tooltip=Refresh the selected configuration command.debug.label=Debug command.debug.tooltip=Starts the debugger diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java index d8e9fe81d..d351b4b62 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java @@ -201,7 +201,6 @@ public class Messages extends NLS { public static String ToolbarAction_selectPeer; public static String ToolbarAction_selectionDialog_title; public static String ToolbarAction_selectionDialog_description; - public static String ToolbarAction_selectionDialog_button_showOnlyReachable; public static String LoggingPreferencePage_label; public static String LoggingPreferencePage_enabled_label; diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties index 3570aa448..edb94ae9e 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties @@ -11,7 +11,7 @@ PossibleCause=Possible Cause:\n{0} OverviewEditorPage_title=Overview -OverviewEditorPage_error_save=Failed to save target: {0}.\n\n{1} +OverviewEditorPage_error_save=Failed to save configuration: {0}.\n\n{1} GeneralInformationSection_title=General Information GeneralInformationSection_description=This section describes general information about this target. @@ -23,7 +23,7 @@ GeneralInformationSection_state_1=Communicating GeneralInformationSection_state_2=Not Reachable. Connection attempt timed out. GeneralInformationSection_state_3=Not Reachable. Connection attempt failed. GeneralInformationSection_state_4=Waiting to become Ready. -GeneralInformationSection_error_delete=Failed to remove old target: {0}.\n\n{1} +GeneralInformationSection_error_delete=Failed to remove old configuration: {0}.\n\n{1} GeneralInformationSection_error_emptyName=The target name cannot be empty. GeneralInformationSection_error_nameInUse=The target name is already used. Please choose a unique name. @@ -49,22 +49,22 @@ AttributesSection_description=This section describes the custom attributes. ContentProviderDelegate_newNode=Create New Target... -NewTargetWizard_windowTitle=New Target -NewTargetWizard_newPeer_name=New Target {0} -NewTargetWizard_error_savePeer=Failed to save target: {0} +NewTargetWizard_windowTitle=New Configuration +NewTargetWizard_newPeer_name=New Configuration {0} +NewTargetWizard_error_savePeer=Failed to save configuration: {0} -NewTargetWizardPage_title=New Target +NewTargetWizardPage_title=New Configuration NewTargetWizardPage_description=Specify the attributes of the target to connect to. NewTargetWizardPage_section_transportType=Specify the transport type and properties: NewTargetWizardPage_section_attributes=Specify additional target attributes: -NewTargetWizardPage_error_nameInUse=This target name is already used. Please choose a unique name. +NewTargetWizardPage_error_nameInUse=This configuration name is already used. Please choose a unique name. RemotePeerDiscoveryRootNode_label=Neighborhood PeerIdControl_label=Target ID: -PeerNameControl_label=Target Name: -PeerNameControl_Information_MissingName=Please enter a valid target name. +PeerNameControl_label=Configuration Name: +PeerNameControl_Information_MissingName=Please enter a valid configuration name. TransportTypeControl_label=Type: TransportTypeControl_tcpType_label=TCP @@ -101,10 +101,10 @@ PeerAttributesTablePart_edit_title=Edit Attribute PeerAttributesTablePart_edit_message=Edit the selected target attribute. DeleteHandler_error_title=Error -DeleteHandler_error_deleteFailed=Failed to delete static target.\n\n{0} +DeleteHandler_error_deleteFailed=Failed to delete configuration.\n\n{0} DeleteHandlerDelegate_DialogTitle=Confirm Delete -DeleteHandlerDelegate_MsgDeleteMultiplePeers=Are you sure you want to delete these {0} targets? -DeleteHandlerDelegate_MsgDeleteOnePeer=Are you sure you want to delete target ''{0}''? +DeleteHandlerDelegate_MsgDeleteMultiplePeers=Are you sure you want to delete these {0} configurations? +DeleteHandlerDelegate_MsgDeleteOnePeer=Are you sure you want to delete configuration ''{0}''? PeerSelectionDialog_dialogTitle=Select PeerSelectionDialog_title=Select Peer @@ -131,10 +131,10 @@ OfflineCommandHandler_error_makeOffline_failed=Failed to create offline copy of CategoryManager_dnd_failed=DND operation failed: {0} RenameHandler_error_title=Error -RenameHandler_error_renameFailed=Failed to rename static target. +RenameHandler_error_renameFailed=Failed to rename configuration. RenameHandler_dialog_title=Rename ''{0}'' -RenameHandler_dialog_message=Please enter a new name for the selected target. -RenameHandler_dialog_error_nameExist=A target with the name you specified already exists! Specify a different name. +RenameHandler_dialog_message=Please enter a new name for the selected configuration. +RenameHandler_dialog_error_nameExist=A configuration with the name you specified already exists! Specify a different name. RenameHandler_dialog_promptNewName=New Name: TargetSelectorSection_title=Target @@ -155,10 +155,9 @@ AbstractConfigWizardPage_connect_label=Connect configuration on finish AbstractConfigWizardPage_launchDbg_label=Start debugger after configuration has been established AbstractConfigWizardPage_advancedButton_label=Advanced... -ToolbarAction_selectPeer=Select Existing Target... -ToolbarAction_selectionDialog_title=Select Existing Target -ToolbarAction_selectionDialog_description=Select an existing target. -ToolbarAction_selectionDialog_button_showOnlyReachable=Show only reachable targets +ToolbarAction_selectPeer=Select Existing Configuration... +ToolbarAction_selectionDialog_title=Select Existing Configuration +ToolbarAction_selectionDialog_description=Select an existing configuration. # ***** Preference Pages ***** @@ -178,31 +177,31 @@ EditorSaveAsAdapter_message=Please enter a new name. EditorSaveAsAdapter_nameInUse_error=The name is already in use. EditorSaveAsAdapter_label=New Name: -PeerExportWizard_title=Export Targets -PeerExportWizard_message=Select the target(s) to export. +PeerExportWizard_title=Export Configurations +PeerExportWizard_message=Select the configuration(s) to export. PeerExportWizardPage_selectAll=Select All PeerExportWizardPage_deselectAll=Deselect All PeerExportWizardPage_peers_label=Connections: PeerExportWizardPage_destination_label=Location: PeerExportWizardPage_destination_button=Browse... -PeerExportWizardPage_peersMissing_error=Please select a target to export. -PeerExportWizardPage_destinationMissing_error=Please enter or select a directory to export the target(s) to. -PeerExportWizardPage_destinationIsFile_error=Please enter or select a valid directory to export the target(s) to. +PeerExportWizardPage_peersMissing_error=Please select a configuration to export. +PeerExportWizardPage_destinationMissing_error=Please enter or select a directory to export the configuration(s) to. +PeerExportWizardPage_destinationIsFile_error=Please enter or select a valid directory to export the configuration(s) to. PeerExportWizardPage_overwrite_button=Overwrite existing file(s) without warning PeerExportWizardPage_overwriteDialog_message=The file ''{0}'' already exists. Do you want to overwrite it? PeerExportWizardPage_overwriteDialogToggle_message=Remember my decision -PeerImportWizard_title=Import Targets -PeerImportWizard_message=Select the target(s) to Import. +PeerImportWizard_title=Import Configurations +PeerImportWizard_message=Select the configuration(s) to Import. PeerImportWizardPage_selectAll=Select All PeerImportWizardPage_deselectAll=Deselect All PeerImportWizardPage_peers_label=Connections: PeerImportWizardPage_destination_label=Location: PeerImportWizardPage_destination_button=Browse... -PeerImportWizardPage_peersMissing_error=Please select a target to import. -PeerImportWizardPage_locationMissing_error=Please enter or select a directory to import the target(s) from. -PeerImportWizardPage_locationIsFile_error=Please enter or select a valid directory to import the target(s) from. -PeerImportWizardPage_overwrite_button=Overwrite existing target(s) without warning +PeerImportWizardPage_peersMissing_error=Please select a configuration to import. +PeerImportWizardPage_locationMissing_error=Please enter or select a directory to import the configuration(s) from. +PeerImportWizardPage_locationIsFile_error=Please enter or select a valid directory to import the configuration(s) from. +PeerImportWizardPage_overwrite_button=Overwrite existing configuration(s) without warning PeerImportWizardPage_overwriteDialog_message=The target ''{0}'' already exists. Do you want to overwrite it? PeerImportWizardPage_overwriteDialogToggle_message=Remember my decision diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java index 378d4ab75..f54b7e80b 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/NewTargetWizard.java @@ -32,6 +32,8 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.persistence.interfaces.IURIPersistenceService; import org.eclipse.tcf.te.runtime.properties.PropertiesContainer; import org.eclipse.tcf.te.runtime.services.ServiceManager; +import org.eclipse.tcf.te.runtime.services.interfaces.IPropertiesAccessService; +import org.eclipse.tcf.te.runtime.services.interfaces.constants.IPropertiesAccessServiceConstants; import org.eclipse.tcf.te.tcf.core.peers.Peer; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService; @@ -73,6 +75,39 @@ public class NewTargetWizard extends AbstractWizard implements INewWizard { addPage(new NewTargetWizardPage()); } + /* (non-Javadoc) + * @see org.eclipse.tcf.te.ui.wizards.AbstractWizard#getInitialData() + */ + @Override + protected IPropertiesContainer getInitialData() { + IStructuredSelection selection = getSelection(); + if (selection != null) { + IPeer peer = null; + if (selection.getFirstElement() instanceof IPeer) { + peer = (IPeer)selection.getFirstElement(); + } + if (selection.getFirstElement() instanceof IPeerNode) { + peer = ((IPeerNode)selection.getFirstElement()).getPeer(); + } + + if (peer != null) { + IPropertiesContainer data = new PropertiesContainer(); + IPropertiesAccessService service = ServiceManager.getInstance().getService(peer, IPropertiesAccessService.class); + Map attrs = service.getTargetAddress(peer); + String peerName = attrs.get(IPropertiesAccessServiceConstants.PROP_NAME); + String peerHost = attrs.get(IPropertiesAccessServiceConstants.PROP_ADDRESS); + String peerPort = attrs.get(IPropertiesAccessServiceConstants.PROP_PORT); + + data.setProperty(IPeer.ATTR_NAME, peerName); + data.setProperty(IPeer.ATTR_IP_HOST, peerHost); + data.setProperty(IPeer.ATTR_IP_PORT, peerPort); + + return data; + } + } + return super.getInitialData(); + } + /** * Extract the peer attributes from the wizard pages. * diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java index 7be4de044..5f9ad1c7d 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java @@ -406,13 +406,6 @@ public abstract class AbstractConfigWizardPage extends AbstractFormsWizardPage i return result; } - /* (non-Javadoc) - * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode#setupData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer) - */ - @Override - public void setupData(IPropertiesContainer data) { - } - /** * Updates the given attributes properties container with the current control content. * @@ -466,6 +459,19 @@ public abstract class AbstractConfigWizardPage extends AbstractFormsWizardPage i updatePeerAttributes(data); } + /* (non-Javadoc) + * @see org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode#setupData(org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer) + */ + @Override + public void setupData(IPropertiesContainer data) { + if (selectorSection instanceof IDataExchangeNode) { + ((IDataExchangeNode)selectorSection).setupData(data); + } + if (detailsSection instanceof IDataExchangeNode) { + ((IDataExchangeNode)detailsSection).setupData(data); + } + } + /* (non-Javadoc) * @see org.eclipse.tcf.te.ui.wizards.pages.AbstractWizardPage#saveWidgetValues() */ diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java index dde95c4bb..ca703c01e 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java @@ -367,6 +367,15 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements */ @Override public void setupData(IPropertiesContainer data) { + + if (data.containsKey(IPeer.ATTR_NAME) && peerNameControl != null) { + peerNameControl.setEditFieldControlText(data.getStringProperty(IPeer.ATTR_NAME)); + } + + IWizardConfigurationPanel panel = transportTypePanelControl != null ? transportTypePanelControl.getActiveConfigurationPanel() : null; + if (panel instanceof IDataExchangeNode) { + ((IDataExchangeNode)panel).setupData(data); + } } /** diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java index 4228cc012..9980dbc0d 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java @@ -11,8 +11,12 @@ package org.eclipse.tcf.te.ui.wizards; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.ui.activator.UIPlugin; +import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchWizard; @@ -76,6 +80,32 @@ public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard return getClass().getName(); } + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#createPageControls(org.eclipse.swt.widgets.Composite) + */ + @Override + public void createPageControls(Composite pageContainer) { + super.createPageControls(pageContainer); + + IPropertiesContainer data = getInitialData(); + if (data != null && !data.isEmpty()) { + for (IWizardPage page : getPages()) { + if (page instanceof IDataExchangeNode) { + ((IDataExchangeNode)page).setupData(data); + } + } + } + } + + /** + * Get the data to initialize wizard pages. + * @return The initial data for all wizard pages or null. + */ + protected IPropertiesContainer getInitialData() { + return null; + } + /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#getDialogSettings() */ -- cgit v1.2.3