*
* @author mschenke
* @version 1.0
+ *
+ *
*/
public class TextWorkstationConstants {
- private static final transient IUFStatusHandler statusHandler = UFStatus
- .getHandler(TextWorkstationConstants.class);
-
- private static IPersistentPreferenceStore store = null;
private static final String TEXTWORKSTATION_QUEUE = "textWorkstation";
public static final String P_TEXTWORKSTATION_ID = "workstationId";
- private static String host = null;
-
- private static String TEXTWS = System.getenv("TEXTWS");
+ private static String host = "localhost";
public static String getId() {
- IPersistentPreferenceStore store = getPreferenceStore();
- String id = store.getString(P_TEXTWORKSTATION_ID);
- if (id == null || id.trim().equals("")) {
- id = TEXTWS;
- if (id != null && !id.trim().equals("")) {
- store.putValue(P_TEXTWORKSTATION_ID, id);
- try {
- store.save();
- } catch (IOException e) {
- statusHandler.handle(Priority.PROBLEM,
- e.getLocalizedMessage(), e);
- }
- }
- }
- return id;
+ return host;
}
/**
@@ -135,47 +104,6 @@ public class TextWorkstationConstants {
return host;
}
- public static IPersistentPreferenceStore getPreferenceStore() {
- if (store == null) {
- IPathManager pm = PathManagerFactory.getPathManager();
- final LocalizationFile file = pm.getLocalizationFile(pm
- .getContext(LocalizationType.CAVE_STATIC,
- LocalizationLevel.WORKSTATION), "textWs"
- + File.separator + "textws.prefs");
- File f = file.getFile();
- if (f.exists() == false) {
- try {
- f.getParentFile().mkdirs();
- f.createNewFile();
- } catch (IOException e) {
- statusHandler.handle(Priority.PROBLEM,
- "Error getting text workstation preferences", e);
- }
- }
- store = new PreferenceStore(file.getFile().getAbsolutePath()) {
-
- @Override
- public void save() throws IOException {
- super.save();
- try {
- file.save();
- } catch (LocalizationException e) {
- statusHandler.handle(Priority.PROBLEM,
- "Error saving text workstation preferences", e);
- }
- }
-
- };
- try {
- ((PreferenceStore) store).load();
- } catch (IOException e) {
- statusHandler.handle(Priority.PROBLEM,
- "Error loading text workstation preferences", e);
- }
- }
- return store;
- }
-
public static String getDestinationTextWorkstationQueueName()
throws UnknownHostException {
StringBuilder queueName = getTextWorkstationQueueNameBuilder();
diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationPreferences.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationPreferences.java
deleted file mode 100644
index 12d232ad39..0000000000
--- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/TextWorkstationPreferences.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.viz.texteditor;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.jface.preference.StringFieldEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * TODO Add Description
- *
- *
- *
- * SOFTWARE HISTORY
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Nov 11, 2009 mschenke Initial creation
- *
- *
- *
- * @author mschenke
- * @version 1.0
- */
-
-public class TextWorkstationPreferences extends FieldEditorPreferencePage
- implements IWorkbenchPreferencePage {
-
- private StringFieldEditor hostEditor;
-
- public TextWorkstationPreferences() {
- super(GRID);
- setPreferenceStore(TextWorkstationConstants.getPreferenceStore());
- setDescription("Specify the host for Text Workstation communication."
- + " Should be the network accessible host of workstation as seen"
- + " in the Text Workstation dialog.");
- }
-
- @Override
- protected void createFieldEditors() {
- // Make sure we grab the env variable if needed
- TextWorkstationConstants.getId();
- hostEditor = new StringFieldEditor(
- TextWorkstationConstants.P_TEXTWORKSTATION_ID,
- "Text Workstation host: ", getFieldEditorParent()) {
-
- private String ip;
-
- @Override
- protected boolean checkState() {
- String host = getTextControl().getText();
- boolean rval = true;
- try {
- ip = InetAddress.getByName(host).getHostAddress();
- } catch (UnknownHostException e) {
- rval = false;
- }
-
- if (rval == false) {
- getTextControl().setBackground(
- getShell().getDisplay().getSystemColor(
- SWT.COLOR_RED));
- } else {
- getTextControl().setBackground(
- getShell().getDisplay().getSystemColor(
- SWT.COLOR_WHITE));
- }
-
- return rval;
- }
-
- @Override
- protected void doStore() {
- boolean rval = true;
- if (ip != null && ip.startsWith("127.0.")) {
- rval = MessageDialog
- .openQuestion(
- getShell(),
- "Confirm",
- "The host string you entered maps to a localhost"
- + " ip address, are you sure this is"
- + " the host name as seen in the Text Workstation dialog?");
- }
- if (rval) {
- super.doStore();
- }
- }
-
- };
-
- hostEditor
- .setErrorMessage("Unable to validate hostname for text workstation");
- addField(hostEditor);
- }
-
- @Override
- public void init(IWorkbench workbench) {
- // TODO Auto-generated method stub
- }
-
-}
diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
index 351e4cac4b..d7b1277200 100644
--- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
+++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java
@@ -6643,7 +6643,7 @@ public class TextEditorDialog extends CaveSWTDialog
}
/**
- * Clear the information on the text workstaion button for this text editor
+ * Clear the information on the text workstation button for this text editor
* dialog.
*/
public void clearButtonology() {
diff --git a/cave/com.raytheon.viz.textworkstation/plugin.xml b/cave/com.raytheon.viz.textworkstation/plugin.xml
index ff5a5fafaf..52668041d3 100644
--- a/cave/com.raytheon.viz.textworkstation/plugin.xml
+++ b/cave/com.raytheon.viz.textworkstation/plugin.xml
@@ -54,22 +54,5 @@
point="com.raytheon.uf.viz.core.component">