Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2010-09-04 21:54:59 +0000
committerMartin Fluegge2010-09-04 21:54:59 +0000
commitc260f5d2eb5d262505a0ae115b7b3abf6f37fe66 (patch)
tree0bf50688c3217213278b26c3f5f8156fca759c74 /plugins/org.eclipse.net4j.ui/src/org
parent56da1c541b96defa03ec02384e77fdccf1add351 (diff)
downloadcdo-c260f5d2eb5d262505a0ae115b7b3abf6f37fe66.tar.gz
cdo-c260f5d2eb5d262505a0ae115b7b3abf6f37fe66.tar.xz
cdo-c260f5d2eb5d262505a0ae115b7b3abf6f37fe66.zip
fixed warnings and added connector wizards
Diffstat (limited to 'plugins/org.eclipse.net4j.ui/src/org')
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/JVMConnectorWizard.java54
-rw-r--r--plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/TCPConnectorWizard.java84
2 files changed, 138 insertions, 0 deletions
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/JVMConnectorWizard.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/JVMConnectorWizard.java
new file mode 100644
index 0000000000..20d1192637
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/JVMConnectorWizard.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) 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:
+ * Eike Stepper - initial API and implementation
+ * Martin Fluegge - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ui.container;
+
+import org.eclipse.net4j.util.factory.ProductCreationException;
+import org.eclipse.net4j.util.ui.container.ElementWizard;
+import org.eclipse.net4j.util.ui.container.ElementWizardFactory;
+
+import org.eclipse.spi.net4j.ConnectorFactory;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Eike Stepper
+ * @author Martin Fluegge
+ * @since 3.1
+ */
+public class JVMConnectorWizard extends ElementWizard
+{
+ public JVMConnectorWizard()
+ {
+ }
+
+ @Override
+ protected void create(Composite parent)
+ {
+ addText(parent, "Acceptor Name:");
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class Factory extends ElementWizardFactory
+ {
+ public Factory()
+ {
+ super(ConnectorFactory.PRODUCT_GROUP, "jvm");
+ }
+
+ @Override
+ public JVMConnectorWizard create(String description) throws ProductCreationException
+ {
+ return new JVMConnectorWizard();
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/TCPConnectorWizard.java b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/TCPConnectorWizard.java
new file mode 100644
index 0000000000..414b52f489
--- /dev/null
+++ b/plugins/org.eclipse.net4j.ui/src/org/eclipse/net4j/internal/ui/container/TCPConnectorWizard.java
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) 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:
+ * Eike Stepper - initial API and implementation
+ * Martin Fluegge - initial API and implementation
+ */
+package org.eclipse.net4j.internal.ui.container;
+
+import org.eclipse.net4j.util.factory.ProductCreationException;
+import org.eclipse.net4j.util.ui.container.ElementWizard;
+import org.eclipse.net4j.util.ui.container.ElementWizardFactory;
+
+import org.eclipse.spi.net4j.ConnectorFactory;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author Eike Stepper
+ * @author Martin Fluegge
+ * @since 3.1
+ */
+public class TCPConnectorWizard extends ElementWizard implements ModifyListener
+{
+ private Text hostText;
+
+ private Text portText;
+
+ public TCPConnectorWizard()
+ {
+ }
+
+ @Override
+ protected void create(Composite parent)
+ {
+ hostText = addText(parent, "Host:");
+ hostText.addModifyListener(this);
+
+ portText = addText(parent, "Port:");
+ portText.addModifyListener(this);
+ }
+
+ public void modifyText(ModifyEvent e)
+ {
+ String host = hostText.getText();
+ if (host.length() == 0)
+ {
+ setErrorMessage("Host name is empty.");
+ return;
+ }
+
+ String port = portText.getText();
+ if (port.length() != 0)
+ {
+ host += ":" + port;
+ }
+
+ setResultDescription(host);
+ setErrorMessage(null);
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ public static class Factory extends ElementWizardFactory
+ {
+ public Factory()
+ {
+ super(ConnectorFactory.PRODUCT_GROUP, "tcp");
+ }
+
+ @Override
+ public TCPConnectorWizard create(String description) throws ProductCreationException
+ {
+ return new TCPConnectorWizard();
+ }
+ }
+}

Back to the top