Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2014-02-19 02:45:08 -0500
committerTobias Schwarz2014-02-19 02:45:35 -0500
commit84f8bf518148c1958727fa59faa302c21594dc53 (patch)
tree07e433a76cd1d8380886b6b0ee9e440d0e5415c9
parent2f302e9330d1ff238d813e646363dbe5a0b61239 (diff)
downloadorg.eclipse.tcf-84f8bf518148c1958727fa59faa302c21594dc53.tar.gz
org.eclipse.tcf-84f8bf518148c1958727fa59faa302c21594dc53.tar.xz
org.eclipse.tcf-84f8bf518148c1958727fa59faa302c21594dc53.zip
Target Explorer: fix wizard validation
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/AbstractItemListPersistenceDelegate.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java12
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java3
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/nls/Messages.properties1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/AbstractConfigWizardPage.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/wizards/pages/NewTargetWizardPage.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/wizards/AbstractWizard.java6
8 files changed, 26 insertions, 9 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/AbstractItemListPersistenceDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/AbstractItemListPersistenceDelegate.java
index a7e74f11d..135ad1587 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/AbstractItemListPersistenceDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.launch.core/src/org/eclipse/tcf/te/launch/core/persistence/AbstractItemListPersistenceDelegate.java
@@ -216,7 +216,7 @@ public abstract class AbstractItemListPersistenceDelegate<ItemType> {
"Launch framework internal error: " + e.getLocalizedMessage(), e); //$NON-NLS-1$
Platform.getLog(CoreBundleActivator.getContext().getBundle()).log(status);
}
- items = null;
+ items.clear();
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java
index 6886422b9..e96eafe17 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/editor/sections/TcpTransportSection.java
@@ -327,12 +327,15 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang
boolean isAutoPort = data.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO);
if (addressControl != null) {
- addressControl.setEditFieldControlText(data.getStringProperty(IPeer.ATTR_IP_HOST));
+ String ip = data.getStringProperty(IPeer.ATTR_IP_HOST);
+ if (ip != null)
+ addressControl.setEditFieldControlText(ip);
}
if (portControl != null) {
String port = data.getStringProperty(IPeer.ATTR_IP_PORT);
- portControl.setEditFieldControlText(port != null ? port : ""); //$NON-NLS-1$
+ if (port != null)
+ portControl.setEditFieldControlText(port);
}
setIsAutoPort(isAutoPort);
@@ -612,13 +615,14 @@ public class TcpTransportSection extends AbstractSection implements IDataExchang
}
}
- if (portControl != null) {
+ boolean autoPort = odc.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO);
+
+ if (!autoPort && portControl != null) {
String port = portControl.getEditFieldControlText();
String oldPort = odc.getStringProperty(IPeer.ATTR_IP_PORT);
isDirty |= !port.equals(oldPort != null ? oldPort : ""); //$NON-NLS-1$
}
- boolean autoPort = odc.getBooleanProperty(IWireTypeNetwork.PROPERTY_NETWORK_PORT_IS_AUTO);
isDirty |= isAutoPort() != autoPort;
// If dirty, mark the form part dirty.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java
index 9d736be66..7e3c47633 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/handler/RenameHandler.java
@@ -238,9 +238,10 @@ public class RenameHandler extends AbstractHandler {
String title = NLS.bind(Messages.RenameHandler_dialog_title, name.get());
String prompt = Messages.RenameHandler_dialog_message;
String usedError = Messages.RenameHandler_dialog_error_nameExist;
+ String formatError = Messages.RenameHandler_dialog_error_nameFormat;
String label = Messages.RenameHandler_dialog_promptNewName;
- return new RenameDialog(shell, null, title, prompt, usedError, null, label, name.get(), null, usedNames.toArray(new String[usedNames.size()]), null);
+ return new RenameDialog(shell, null, title, prompt, usedError, formatError, label, name.get(), "[0-9a-zA-Z. _()-]+", usedNames.toArray(new String[usedNames.size()]), null); //$NON-NLS-1$
}
}
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 58e72f717..811ec0618 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
@@ -167,6 +167,7 @@ public class Messages extends NLS {
public static String RenameHandler_dialog_title;
public static String RenameHandler_dialog_message;
public static String RenameHandler_dialog_error_nameExist;
+ public static String RenameHandler_dialog_error_nameFormat;
public static String RenameHandler_dialog_promptNewName;
public static String TargetSelectorSection_title;
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 a1e8dcb13..b05fccd2c 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
@@ -124,6 +124,7 @@ RenameHandler_error_renameFailed=Failed to rename connection.
RenameHandler_dialog_title=Rename ''{0}''
RenameHandler_dialog_message=Please enter a new name for the selected connection.
RenameHandler_dialog_error_nameExist=A connection with the name you specified already exists! Specify a different name.
+RenameHandler_dialog_error_nameFormat=The name you specified contains illegal characters. Specify a different name.
RenameHandler_dialog_promptNewName=New Name:
TargetSelectorSection_title=Target
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 2c5b06fb3..c153cd51c 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
@@ -80,7 +80,7 @@ public abstract class AbstractConfigWizardPage extends AbstractFormsWizardPage i
*/
@Override
protected Validator doCreateEditFieldValidator() {
- return new RegexValidator(Validator.ATTR_MANDATORY, ".*"); //$NON-NLS-1$
+ return new RegexValidator(Validator.ATTR_MANDATORY, "[0-9a-zA-Z. _()-]+"); //$NON-NLS-1$
}
/* (non-Javadoc)
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 b3ce31225..aea490d2f 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
@@ -45,6 +45,7 @@ import org.eclipse.tcf.te.tcf.ui.dialogs.PeerSelectionDialog;
import org.eclipse.tcf.te.tcf.ui.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.ui.nls.Messages;
import org.eclipse.tcf.te.ui.controls.interfaces.IWizardConfigurationPanel;
+import org.eclipse.tcf.te.ui.controls.validator.RegexValidator;
import org.eclipse.tcf.te.ui.controls.validator.TextValidator;
import org.eclipse.tcf.te.ui.controls.validator.Validator;
import org.eclipse.tcf.te.ui.forms.FormLayoutFactory;
@@ -276,6 +277,13 @@ public class NewTargetWizardPage extends AbstractValidatingWizardPage implements
}
}
}
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.controls.BaseEditBrowseTextControl#doCreateEditFieldValidator()
+ */
+ @Override
+ protected Validator doCreateEditFieldValidator() {
+ return new RegexValidator(Validator.ATTR_MANDATORY, "[0-9a-zA-Z. _()-]+"); //$NON-NLS-1$
+ }
@Override
protected void configureEditFieldValidator(Validator validator) {
if (validator == null) return;
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 4dd8aab27..95a0c3a65 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
@@ -15,6 +15,7 @@ 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.runtime.properties.PropertiesContainer;
import org.eclipse.tcf.te.ui.activator.UIPlugin;
import org.eclipse.tcf.te.ui.interfaces.data.IDataExchangeNode;
import org.eclipse.tcf.te.ui.wizards.pages.AbstractValidatingWizardPage;
@@ -90,7 +91,8 @@ public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard
super.createPageControls(pageContainer);
IPropertiesContainer data = getInitialData();
- if (data != null && !data.isEmpty()) {
+ if (data == null) data = new PropertiesContainer();
+// if (data != null && !data.isEmpty()) {
for (IWizardPage page : getPages()) {
if (page instanceof IDataExchangeNode) {
((IDataExchangeNode)page).setupData(data);
@@ -99,7 +101,7 @@ public abstract class AbstractWizard extends Wizard implements IWorkbenchWizard
}
}
}
- }
+// }
}
/**

Back to the top