org.eclipse.ohf.stem.ui.ge.views
Class GEPreferencePage

java.lang.Object
  extended by org.eclipse.jface.dialogs.DialogPage
      extended by org.eclipse.jface.preference.PreferencePage
          extended by org.eclipse.jface.preference.FieldEditorPreferencePage
              extended by org.eclipse.ohf.stem.ui.ge.views.GEPreferencePage
All Implemented Interfaces:
java.util.EventListener, org.eclipse.jface.dialogs.IDialogPage, org.eclipse.jface.dialogs.IMessageProvider, org.eclipse.jface.preference.IPreferencePage, org.eclipse.jface.util.IPropertyChangeListener, org.eclipse.ui.IWorkbenchPreferencePage

public class GEPreferencePage
extends org.eclipse.jface.preference.FieldEditorPreferencePage
implements org.eclipse.ui.IWorkbenchPreferencePage

Handle Preferences for the STEM - GoogleEarth interface.

 This class contains the following:
   - code to present the setting of the preferences 
     by the user.  The gui for some preferences are 
     handled by GEAdvancedPreferencePage
     
   - getter/setter code for all of the preferences. 
     mostly getter.
   
   - code to pick up the aspect preference from the 
     visualization page.
 
 This class was initialy generated by the PreferencePage wizard and 
 then modified as described in 
 "Building Comercial-Quality Plugins" 
 
 This class represents a preference page that
 is contributed to the Preferences dialog. By 
 subclassing FieldEditorPreferencePage, we
 can use the field support built into JFace that allows
 us to create a page that is small and knows how to 
 save, restore and apply itself.
 

This page is used to modify preferences only. They are stored in the preference store that belongs to the main plug-in class. That way, preferences can be accessed directly via the preference store. This uses the jface Preferences API rather than the new SWT Preferences API because it is simpler to implement.


Field Summary
static int M_ASYNC_SERVLET
          always write the control.kml file and start a servlet to read the latest version.
static int M_AUTO_LAUNCH
          Build a KML file and launch it directly to GoogleEarth
static int M_LOG_ONLY
          Only Log KML for later display
static int M_LOG_SERVLET
          Log the KML files and start the networkLink process
static int M_MANUAL_DISPLAY
          Do not do anything automatically.
static org.eclipse.jface.preference.IPreferenceStore preferences
           
 
Fields inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
FLAT, GRID
 
Fields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING
 
Constructor Summary
GEPreferencePage()
          construct the Preference page for GoogleEarth interface.
 
Method Summary
 void createFieldEditors()
          Creates the field editors.
static java.lang.String display()
          To display all of the Preferences.
static Aspect getAspect()
          get the specified Aspect that will be logged or displayed
static java.lang.String getFolder()
           
static int getMethod()
          This will return a code 1 to 5 indicating the method used to display KML.
static java.lang.String getServerHost()
           
static int getWhichCycle()
           
 void init(org.eclipse.ui.IWorkbench workbench)
           
static boolean isAutoLaunch()
           
static boolean isAutoLogging()
           
static boolean isBBOX()
           
static boolean isDebug()
           
static boolean isInternalServer()
           
static boolean isShowBorder()
           
static boolean isTest()
           
 boolean performOk()
           
static void setAspect(java.lang.String aspectStr)
          set the Aspect that will be displayed
static void setFolder(java.lang.String logFolder)
           
static void setMethod(int newMethod)
          Set the Method that STEM coummicates with GE
 
Methods inherited from class org.eclipse.jface.preference.FieldEditorPreferencePage
dispose, propertyChange, setVisible
 
Methods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, computeSize, createControl, getContainer, getPreferenceStore, isValid, okToLeave, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString
 
Methods inherited from class org.eclipse.jface.dialogs.DialogPage
getControl, getDescription, getErrorMessage, getImage, getMessage, getMessageType, getShell, getTitle, setDescription, setImageDescriptor, setMessage
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
 
Methods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisible
 

Field Detail

M_LOG_ONLY

public static final int M_LOG_ONLY
Only Log KML for later display

See Also:
Constant Field Values

M_LOG_SERVLET

public static final int M_LOG_SERVLET
Log the KML files and start the networkLink process

See Also:
Constant Field Values

M_ASYNC_SERVLET

public static final int M_ASYNC_SERVLET
always write the control.kml file and start a servlet to read the latest version. Advantage is that GoogleEarth is always reading the latest version and will not fall behind.

See Also:
Constant Field Values

M_AUTO_LAUNCH

public static final int M_AUTO_LAUNCH
Build a KML file and launch it directly to GoogleEarth

See Also:
Constant Field Values

M_MANUAL_DISPLAY

public static final int M_MANUAL_DISPLAY
Do not do anything automatically. Only generate a KML file at request of user.

See Also:
Constant Field Values

preferences

public static final org.eclipse.jface.preference.IPreferenceStore preferences
Constructor Detail

GEPreferencePage

public GEPreferencePage()
construct the Preference page for GoogleEarth interface.

Method Detail

init

public void init(org.eclipse.ui.IWorkbench workbench)
Specified by:
init in interface org.eclipse.ui.IWorkbenchPreferencePage

createFieldEditors

public void createFieldEditors()
Creates the field editors. Field editors are abstractions of the common GUI blocks needed to manipulate various types of preferences. Each field editor knows how to save and restore itself.

Specified by:
createFieldEditors in class org.eclipse.jface.preference.FieldEditorPreferencePage

performOk

public boolean performOk()
Specified by:
performOk in interface org.eclipse.jface.preference.IPreferencePage
Overrides:
performOk in class org.eclipse.jface.preference.FieldEditorPreferencePage

getFolder

public static java.lang.String getFolder()
Returns:
the logFolder

setFolder

public static void setFolder(java.lang.String logFolder)
Parameters:
logFolder - the logFolder to set

getServerHost

public static java.lang.String getServerHost()
Returns:
the serverHost

getMethod

public static int getMethod()
This will return a code 1 to 5 indicating the method used to display KML. M_LOG_ONLY = 1; M_LOG_SERVLET = 2; M_ASYNC_SERVLET = 3; M_AUTO_LAUNCH = 4; M_MANUAL_DISPLAY = 5; If there is no Servlet support, it will modify what is returned to avoid being dependent on a servlet.

Returns:
the method code to be used to display KML

setMethod

public static void setMethod(int newMethod)
Set the Method that STEM coummicates with GE

Parameters:
newMethod - New method to set

isInternalServer

public static boolean isInternalServer()
Returns:
the internalServer flag If true then the info about the status of the server is handled by the StemKML code.

isAutoLaunch

public static boolean isAutoLaunch()
Returns:
the autoLaunch flag

isAutoLogging

public static boolean isAutoLogging()
Returns:
the autoLogging

getWhichCycle

public static int getWhichCycle()
Returns:
the whichCycle

getAspect

public static Aspect getAspect()
get the specified Aspect that will be logged or displayed

Returns:
Aspect instance or null

setAspect

public static void setAspect(java.lang.String aspectStr)
set the Aspect that will be displayed

Parameters:
aspectStr - Name of the desired Aspect.

isBBOX

public static boolean isBBOX()
Returns:
the BBox filter flag

isDebug

public static boolean isDebug()
Returns:
the Debug flag

isTest

public static boolean isTest()
Returns:
the Test flag
 Uses:
  - Enhanced Debug output (time and thread)
  - Filter out nodes
    - KmlDisplay - if not BBox filter then not US or Mexico
    - KmlDisplayCustom - not US
 To see where else this is used ask to see call hierarchy

isShowBorder

public static boolean isShowBorder()
Returns:
the ShowBorder flag
 With KML you can either show the polygon borders or not.
 This flag will control whether they are shown or not.
 The default is to not show them

display

public static java.lang.String display()
To display all of the Preferences. Please keep this up to date.

Returns:
string describing the current preferences.