summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCong Wang2013-05-09 10:44:22 (EDT)
committerChris Recoskie2013-05-09 10:44:22 (EDT)
commite7551140aad13e2cae8cb0d4522fae42658bedeb (patch)
treed3ddc0101a349cc6cfa8ded97d0799a1c6643c25
parent174ab46ff66ec7a69ce2e8c4b3b30882d42fbf01 (diff)
downloadorg.eclipse.ptp-e7551140aad13e2cae8cb0d4522fae42658bedeb.zip
org.eclipse.ptp-e7551140aad13e2cae8cb0d4522fae42658bedeb.tar.gz
org.eclipse.ptp-e7551140aad13e2cae8cb0d4522fae42658bedeb.tar.bz2
Bug 405351 - service configuration property page does not show which
config is active or allow you to set the active config
-rw-r--r--core/org.eclipse.ptp.services.ui/.settings/.api_filters35
-rw-r--r--core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/ServiceConfigurationPropertyPage.java51
-rw-r--r--core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/Messages.java144
-rw-r--r--core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/messages.properties97
4 files changed, 327 insertions, 0 deletions
diff --git a/core/org.eclipse.ptp.services.ui/.settings/.api_filters b/core/org.eclipse.ptp.services.ui/.settings/.api_filters
new file mode 100644
index 0000000..1d25b4a
--- /dev/null
+++ b/core/org.eclipse.ptp.services.ui/.settings/.api_filters
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?><component id="org.eclipse.ptp.services.ui" version="2">
+ <resource path="META-INF/MANIFEST.MF">
+ <filter id="924844039">
+ <message_arguments>
+ <message_argument value="2.0.0"/>
+ <message_argument value="2.0.0"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/ptp/services/ui/messages/Messages.java" type="org.eclipse.ptp.services.ui.messages.Messages">
+ <filter id="1143996420">
+ <message_arguments>
+ <message_argument value="ServiceConfigurationPropertyPage_3"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/ptp/services/ui/preferences/ServiceConfigurationPreferencePage.java" type="org.eclipse.ptp.services.ui.preferences.ServiceConfigurationPreferencePage">
+ <filter id="1108344834">
+ <message_arguments>
+ <message_argument value="1.0"/>
+ <message_argument value="2.0"/>
+ <message_argument value="org.eclipse.ptp.services.ui.preferences.ServiceConfigurationPreferencePage"/>
+ </message_arguments>
+ </filter>
+ </resource>
+ <resource path="src/org/eclipse/ptp/services/ui/views/ServiceConfigurationView.java" type="org.eclipse.ptp.services.ui.views.ServiceConfigurationView">
+ <filter id="1108344834">
+ <message_arguments>
+ <message_argument value="1.0"/>
+ <message_argument value="2.0"/>
+ <message_argument value="org.eclipse.ptp.services.ui.views.ServiceConfigurationView"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component> \ No newline at end of file
diff --git a/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/ServiceConfigurationPropertyPage.java b/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/ServiceConfigurationPropertyPage.java
index d92a829..b36a336 100644
--- a/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/ServiceConfigurationPropertyPage.java
+++ b/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/ServiceConfigurationPropertyPage.java
@@ -97,6 +97,8 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
addServiceConfiguration();
} else if (source == removeButton) {
removeServiceConfiguration();
+ } else if (source == setActiveConfigButton) {
+ setActiveServiceConfiguration();
} else if (source == serviceModelWidget) {
serviceModelPane.reflow(true);
}
@@ -132,10 +134,12 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
private final EventHandler eventHandler = new EventHandler();
private Composite propertiesPane;
private Button removeButton;
+ private Button setActiveConfigButton;
private ServiceConfigurationComparator serviceConfigurationComparator;
private Table serviceConfigurationList;
private ServiceScrolledComposite serviceModelPane;
private ServiceProviderConfigurationWidget serviceModelWidget;
+ private IServiceConfiguration activeConfig;
/**
* Create the service configuration properties page
@@ -154,6 +158,9 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
deleteServiceConfigurations();
addServiceConfigurations();
serviceModelWidget.applyChangesToConfiguration();
+ if(activeConfig != null) {
+ ServiceModelManager.getInstance().setActiveConfiguration(getProject(), activeConfig);
+ }
try {
ServiceModelManager.getInstance().saveModelConfiguration();
} catch (IOException e) {
@@ -223,6 +230,37 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
deletedServiceConfigurations.clear();
}
}
+
+ /**
+ * User is able to set active service configuration from a set of configurations.
+ */
+ private void setActiveServiceConfiguration() {
+ TableItem selection[];
+ selection = serviceConfigurationList.getSelection();
+ if (selection.length > 0) {
+ activeConfig = (IServiceConfiguration) selection[0].getData();
+ addOrRemoveActiveConfigLabel();
+ }
+ }
+
+ private void addOrRemoveActiveConfigLabel() {
+ if (serviceConfigurationList == null) {
+ return;
+ }
+ String activeLabel = "(Active)";
+ for (TableItem item: serviceConfigurationList.getItems()) {
+ String text = item.getText();
+ if(!item.getData().equals(activeConfig) && text.endsWith(activeLabel)) {
+ int index = text.indexOf(activeLabel);
+ item.setText(text.substring(0, index));
+ }
+ if(item.getData().equals(activeConfig) && !text.endsWith(activeLabel)) {
+ item.setText(text + " " + activeLabel);
+ setActiveConfigButton.setEnabled(false);
+ }
+ }
+
+ }
/**
* Get the project Object
@@ -250,6 +288,7 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
IServiceConfiguration serviceConfigurations[];
try {
+ activeConfig = ServiceModelManager.getInstance().getActiveConfiguration(getProject());
serviceConfigurations = ServiceModelManager.getInstance()
.getConfigurations(getProject()).toArray(new IServiceConfiguration[0]);
Arrays.sort(serviceConfigurations, serviceConfigurationComparator);
@@ -311,6 +350,11 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
serviceModelWidget.setServiceConfiguration(selectedConfig, natures);
serviceModelWidget.setEnabled(true);
serviceModelPane.reflow(true);
+ if (selectedConfig.equals(activeConfig)) {
+ setActiveConfigButton.setEnabled(false);
+ } else {
+ setActiveConfigButton.setEnabled(true);
+ }
}
} else {
currentConfig = null;
@@ -363,6 +407,12 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
data = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
data.widthHint = BUTTON_WIDTH;
removeButton.setLayoutData(data);
+ setActiveConfigButton = new Button(buttonPane, SWT.PUSH);
+ setActiveConfigButton.setText(Messages.ServiceConfigurationPropertyPage_3);
+ setActiveConfigButton.addSelectionListener(eventHandler);
+ data = new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1);
+ data.widthHint = BUTTON_WIDTH;
+ setActiveConfigButton.setLayoutData(data);
// Create the pane which will contain the current service model
serviceModelPane = new ServiceScrolledComposite(propertiesPane, SWT.V_SCROLL|SWT.H_SCROLL);
@@ -383,6 +433,7 @@ public class ServiceConfigurationPropertyPage extends PropertyPage implements
// Fill in the list of service configurations currently used by this
// project
getProjectConfigurations();
+ addOrRemoveActiveConfigLabel();
return propertiesPane;
}
diff --git a/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/Messages.java b/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/Messages.java
new file mode 100644
index 0000000..bc5f88c
--- /dev/null
+++ b/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/Messages.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * 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 - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ptp.services.ui.messages;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+
+ private static final String BUNDLE_NAME = "org.eclipse.ptp.services.ui.messages.messages";//$NON-NLS-1$
+
+ public static String AddServiceConfigurationWidget_0;
+ public static String AddServiceConfigurationWidget_1;
+ public static String AddServiceConfigurationWidget_2;
+ public static String AddServiceConfigurationWidget_3;
+
+ public static String NewServiceConfigurationProjectWizard_0;
+
+ public static String ServiceProviderConfigurationWidget_0;
+ public static String ServiceProviderConfigurationWidget_1;
+ public static String ServiceProviderConfigurationWidget_2;
+ public static String ServiceProviderConfigurationWidget_3;
+
+ public static String ServiceProviderConfigurationWidget_4;
+
+ public static String RemoveServiceConfigurationAction_0;
+ public static String RemoveServiceConfigurationAction_1;
+
+ public static String ServiceConfigurationExportWizard_0;
+ public static String ServiceConfigurationExportWizard_1;
+ public static String ServiceConfigurationExportWizard_4;
+ public static String ServiceConfigurationExportWizard_5;
+ public static String ServiceConfigurationExportWizard_6;
+ public static String ServiceConfigurationExportWizard_7;
+ public static String ServiceConfigurationExportWizard_8;
+ public static String ServiceConfigurationExportWizard_9;
+ public static String ServiceConfigurationExportWizard_10;
+ public static String ServiceConfigurationExportWizard_11;
+ public static String ServiceConfigurationExportWizard_13;
+ public static String ServiceConfigurationExportWizard_14;
+ public static String ServiceConfigurationExportWizard_15;
+
+ public static String ServiceConfigurationImportWizard_0;
+ public static String ServiceConfigurationImportWizard_1;
+ public static String ServiceConfigurationImportWizard_2;
+ public static String ServiceConfigurationImportWizard_3;
+ public static String ServiceConfigurationImportWizard_4;
+ public static String ServiceConfigurationImportWizard_5;
+ public static String ServiceConfigurationImportWizard_6;
+ public static String ServiceConfigurationImportWizard_7;
+ public static String ServiceConfigurationImportWizard_8;
+ public static String ServiceConfigurationImportWizard_9;
+ public static String ServiceConfigurationImportWizard_10;
+ public static String ServiceConfigurationImportWizard_11;
+ public static String ServiceConfigurationImportWizard_12;
+ public static String ServiceConfigurationImportWizard_13;
+
+ public static String ServiceConfigurationPreferencePage_10;
+ public static String ServiceConfigurationPreferencePage_3;
+ public static String ServiceConfigurationPreferencePage_4;
+ public static String ServiceConfigurationPreferencePage_5;
+ public static String ServiceConfigurationPreferencePage_6;
+ public static String ServiceConfigurationPreferencePage_7;
+ public static String ServiceConfigurationPreferencePage_8;
+ public static String ServiceConfigurationPreferencePage_9;
+
+ public static String ServiceConfigurationPropertyPage_0;
+ public static String ServiceConfigurationPropertyPage_1;
+ public static String ServiceConfigurationPropertyPage_2;
+ public static String ServiceConfigurationPropertyPage_3;
+
+ public static String ServiceConfigurationSelectionDialog_0;
+ public static String ServiceConfigurationSelectionDialog_1;
+
+ public static String ServiceConfigurationSelectionWidget_1;
+ public static String ServiceConfigurationSelectionWidget_2;
+ public static String ServiceConfigurationSelectionWidget_3;
+ public static String ServiceConfigurationSelectionWidget_4;
+ public static String ServiceConfigurationSelectionWidget_5;
+ public static String ServiceConfigurationSelectionWidget_6;
+ public static String ServiceConfigurationSelectionWidget_7;
+ public static String ServiceConfigurationSelectionWidget_8;
+ public static String ServiceConfigurationSelectionWidget_9;
+ public static String ServiceConfigurationSelectionWidget_10;
+ public static String ServiceConfigurationSelectionWidget_11;
+ public static String ServiceConfigurationSelectionWidget_12;
+ public static String ServiceConfigurationSelectionWidget_13;
+ public static String ServiceConfigurationSelectionWidget_14;
+
+ public static String ServiceConfigurationSelectionWizardPage_0;
+ public static String ServiceConfigurationSelectionWizardPage_1;
+ public static String ServiceConfigurationSelectionWizardPage_2;
+ public static String ServiceConfigurationSelectionWizardPage_3;
+ public static String ServiceConfigurationSelectionWizardPage_4;
+ public static String ServiceConfigurationSelectionWizardPage_5;
+
+ public static String ServiceConfigurationWidget_0;
+ public static String ServiceConfigurationWidget_1;
+ public static String ServiceConfigurationWidget_2;
+ public static String ServiceConfigurationWidget_3;
+
+ public static String ServiceConfigurationWizard_0;
+ public static String ServiceConfigurationWizard_1;
+ public static String ServiceConfigurationWizard_2;
+ public static String ServiceConfigurationWizard_3;
+ public static String ServiceConfigurationWizard_4;
+ public static String ServiceConfigurationWizard_5;
+ public static String ServiceConfigurationWizard_6;
+
+ public static String ServiceConfigurationWizardPage_0;
+
+ public static String ServiceModelWidget_0;
+ public static String ServiceModelWidget_1;
+ public static String ServiceModelWidget_2;
+ public static String ServiceModelWidget_3;
+ public static String ServiceModelWidget_4;
+ public static String ServiceModelWidget_6;
+ public static String ServiceModelWidget_7;
+
+ public static String ServiceModelWidget_8;
+
+ public static String ServiceProviderConfigurationDialog_0;
+ public static String ServiceProviderConfigurationDialog_title;
+
+ public static String ServiceSelectionDialog_0;
+ public static String ServiceSelectionDialog_1;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+
+}
diff --git a/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/messages.properties b/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/messages.properties
new file mode 100644
index 0000000..4f2019b
--- /dev/null
+++ b/core/org.eclipse.ptp.services.ui/src/org/eclipse/ptp/services/ui/messages/messages.properties
@@ -0,0 +1,97 @@
+AddServiceConfigurationWidget_0=Create a new Service Configuration
+AddServiceConfigurationWidget_1=Configuration Name:
+AddServiceConfigurationWidget_2=Add to an existing Service Configuration
+AddServiceConfigurationWidget_3=Advanced Settings...
+NewServiceConfigurationProjectWizard_0=Service Configuration Selection
+ServiceProviderConfigurationWidget_0=Available Services
+ServiceProviderConfigurationWidget_1=Enable Service
+ServiceProviderConfigurationWidget_2=Service Provider:
+ServiceProviderConfigurationWidget_3=Additional Services
+ServiceProviderConfigurationWidget_4=Configure...
+RemoveServiceConfigurationAction_0=Remove Service Configurations
+RemoveServiceConfigurationAction_1=Are you sure you want to remove the following service configuration(s)?\n
+ServiceConfigurationExportWizard_0=Export the service configuration
+ServiceConfigurationExportWizard_1=Select the service configurations to export:
+ServiceConfigurationExportWizard_10=Export the service configuration file.
+ServiceConfigurationExportWizard_11=Export a Service Configuration
+ServiceConfigurationExportWizard_13=Service Configuration
+ServiceConfigurationExportWizard_14=Confirm Overwrite
+ServiceConfigurationExportWizard_15=File already exists. Are you sure you want to overwrite it?
+ServiceConfigurationExportWizard_4=File name:
+ServiceConfigurationExportWizard_5=Browse...
+ServiceConfigurationExportWizard_6=Service Configuration Files (*.cfg)
+ServiceConfigurationExportWizard_7=serviceConfigurations.cfg
+ServiceConfigurationExportWizard_8=Please specify the destination file.
+ServiceConfigurationExportWizard_9=You have specified a folder.
+ServiceConfigurationImportWizard_0=Importing...
+ServiceConfigurationImportWizard_1=Import service configurations from a file
+ServiceConfigurationImportWizard_10=Service Configuration
+ServiceConfigurationImportWizard_11=Import Service Configurations
+ServiceConfigurationImportWizard_12=Select service configurations to import:
+ServiceConfigurationImportWizard_13=The specified file is not a valid service configuration file.
+ServiceConfigurationImportWizard_2=File name:
+ServiceConfigurationImportWizard_3=Browse...
+ServiceConfigurationImportWizard_4=Service Configuration Files (*.cfg)
+ServiceConfigurationImportWizard_5=All Files (*.*)
+ServiceConfigurationImportWizard_6=Please specify a file to import.
+ServiceConfigurationImportWizard_7=The specified file does not exist.
+ServiceConfigurationImportWizard_8=You have specified a folder.
+ServiceConfigurationImportWizard_9=Import the service configuration file.
+ServiceConfigurationPreferencePage_10=Export...
+ServiceConfigurationPreferencePage_3=New...
+ServiceConfigurationPreferencePage_4=Edit...
+ServiceConfigurationPreferencePage_5=Remove
+ServiceConfigurationPreferencePage_6=new config
+ServiceConfigurationPreferencePage_7=Service Configurations
+ServiceConfigurationPreferencePage_8=Projects
+ServiceConfigurationPreferencePage_9=Import...
+ServiceConfigurationPropertyPage_0=Add
+ServiceConfigurationPropertyPage_1=Remove
+ServiceConfigurationPropertyPage_2=Project Service Configurations
+ServiceConfigurationPropertyPage_3=Set Active
+ServiceConfigurationSelectionDialog_0=Available Service Configurations
+ServiceConfigurationSelectionDialog_1=Select Service Configuration
+ServiceConfigurationSelectionWidget_1=Add...
+ServiceConfigurationSelectionWidget_2=Add Service Configuration
+ServiceConfigurationSelectionWidget_3=Enter a name for the service configuration:
+ServiceConfigurationSelectionWidget_4=Remove
+ServiceConfigurationSelectionWidget_9=Remove Service Configuration
+ServiceConfigurationSelectionWidget_10=Are you sure you want to remove the service configuration(s) {0}?
+ServiceConfigurationSelectionWidget_11=Rename
+ServiceConfigurationSelectionWidget_12=Rename Service Configuration
+ServiceConfigurationSelectionWidget_13=Enter a new name for the new service configuration:
+ServiceConfigurationSelectionWidget_14=Not Configured
+ServiceConfigurationSelectionWidget_5=Select All
+ServiceConfigurationSelectionWidget_6=Deselect All
+ServiceConfigurationSelectionWidget_7=Configuration Name
+ServiceConfigurationSelectionWidget_8=\ Service
+ServiceConfigurationSelectionWizardPage_0=Create or select a service configuration for the project
+ServiceConfigurationSelectionWizardPage_1=One or more service configurations already exist.
+ServiceConfigurationSelectionWizardPage_2=If you wish to use an existing configuration, select it from the list.
+ServiceConfigurationSelectionWizardPage_3=You do not have any existing service configurations, so this wizard will help you create a new one.
+ServiceConfigurationSelectionWizardPage_4=The new configuration will be saved with your project, and can be used when creating new projects in the future.
+ServiceConfigurationSelectionWizardPage_5=Default
+ServiceConfigurationWidget_0=Project
+ServiceConfigurationWidget_1=Configuration
+ServiceConfigurationWidget_2=Status
+ServiceConfigurationWidget_3=Not configured
+ServiceConfigurationWizard_1=Service Configuration Wizard
+ServiceConfigurationWizard_0=This page allows you to make any final additions or configure any remaining services
+ServiceConfigurationWizard_2=This wizard will help you configure Eclipse for HPC application development
+ServiceConfigurationWizard_3=You will be given an opportunity to configure each aspect of the development environment.
+ServiceConfigurationWizard_4=If you make a mistake or configure something incorrectly, simply click on the "Back" button.
+ServiceConfigurationWizard_5=Do not show this page again.
+ServiceConfigurationWizard_6=HPC Project Configuration Wizard
+ServiceConfigurationWizardPage_0=Select a Provider:
+ServiceModelWidget_0=Service
+ServiceModelWidget_1=Provider
+ServiceModelWidget_2=Configure...
+ServiceModelWidget_3=Status
+ServiceModelWidget_4=Not configured
+ServiceModelWidget_6=Add...
+ServiceModelWidget_7=Remove
+ServiceModelWidget_8=Service "{0}" has no providers\!
+ServiceProviderConfigurationDialog_0=Name:
+ServiceProviderConfigurationDialog_title=Edit Service Configuration
+ServiceSelectionDialog_0=Available Services
+ServiceSelectionDialog_1=Select a service to add to the configuration