com.pvx.ooadide.eventmanager
Class EventManager

java.lang.Object
  extended by com.pvx.ooadide.eventmanager.EventManager

public class EventManager
extends java.lang.Object

Controls communication between Eclipse and ProvideX.

Since:
1.0
Version:
1.0, 01/01/2007
Author:
Jarett Smith

Field Summary
static java.lang.String ADDING_RESOURCES_TO_SRC
           
static java.lang.String APPLY_IT_FORMAT
           
static java.lang.String BUILDER_EXE
           
static java.lang.String BUILDTYPE_STRIPLINES_PREP
           
static java.lang.String ECLIPSE_SHUTDOWN
           
static java.lang.String EVENT_FIRED
           
static java.lang.String EVENT_LISTNR
           
static java.lang.String EXPORT
           
static java.lang.String EXT_EVENT
           
static java.lang.String FULL_BUILD
           
static java.lang.String FULL_BUILD_ALT_EXE
           
static java.lang.String FULL_BUILD_END
           
static java.lang.String FULL_BUILD_START
           
static java.lang.String HOST_IS_READY
           
static java.lang.String IMPORT
           
static java.lang.String IMPORT_EXPORT_FILE
           
static java.lang.String IMPORT_EXPORT_PROPERTIES
           
static java.lang.String IMPORTING_END
           
static java.lang.String IMPORTING_START
           
static java.lang.String INCREMENTAL_BUILD
           
static java.lang.String INCREMENTAL_BUILD_ALT_EXE
           
static java.lang.String INVALID
           
static java.lang.String IOLIST_SCAN
           
static java.lang.String LIB_SCAN
           
static java.lang.String LOAD
           
static java.lang.String NAME
           
static java.lang.String NOMADS_BLOCKING
           
static java.lang.String NOMADS_NON_BLOCKING
           
static java.lang.String OPERATION_CANCEL
           
static java.lang.String OPERATION_ERROR
           
static java.lang.String OPERATION_REDO
           
static java.lang.String OPERATION_SUCCESS
           
static java.lang.String PASSWORD
           
static java.lang.String PATH
           
static java.util.Vector<java.lang.Integer> pervasiveHandles
           
static java.lang.String PREFERENCE_CHANGE
           
static java.lang.String PREFERENCE_NEW_VALUE
           
static java.lang.String PREFERENCE_OLD_VALUE
           
static java.lang.String PREFERENCE_PAGE_BUTTON
           
static java.lang.String PREFERENCE_PAGE_ID
           
static java.lang.String PREFERENCE_PROPERTY
           
static java.lang.String PROJECT_INI_FILE
           
static java.lang.String PROJECT_LIST
           
static java.lang.String PROJECT_LOCATION
           
static java.lang.String PROJECT_MEMBER_COUNT
           
static java.lang.String PROJECT_NAME
           
static java.lang.String REMOVE
           
static java.lang.String REMOVED_RESOURCE_FROM_SRC
           
static java.lang.Object REQUEST_SOCKET
           
static java.lang.String RESOURCE_LIST
           
static java.lang.String RESOURCE_PROPERTIES_CHANGED
           
static java.lang.String RUN_CONSOLE
           
static java.lang.String RUN_DESIGNER
           
static java.lang.String RUN_DICT_DATA_CLASS
           
static java.lang.String RUN_DICTMAINT
           
static java.lang.String RUN_HOST
           
static java.lang.String RUN_IT
           
static java.lang.String RUN_NOMADS
           
static java.lang.String RUN_TEST_PANEL
           
static java.lang.String STRIP_LINE_NO
           
static java.lang.String VALID
           
static java.lang.String VALIDATE
           
 
Method Summary
static void addExtJavaEventListener(java.lang.Object listener, java.lang.String commandStr, boolean notifyEvtMngr)
          Adds an AbstractActionListener.
static void addExtPvxEventListener(int listener, java.lang.String commandStr)
          Adds an AbstractActionListener
 void addListener(java.lang.String eventName)
          Adds a listener to the EventManager.
 void addListener(java.lang.String eventName, int ctlValue)
          Adds a listener to the EventManager.
static void addPervasiveObject(int ocxId)
          Most Java objects instantiated by ProvideX are dropped after every event.
 void addToPrefPages(java.lang.String key, java.lang.String value)
          Adds the specified key to an Eclipse Preference page
static void bye()
           
static void clearAllBlocks()
          Frees all blocking PvxEvents
static void collectGarbage()
          Cleans up all objects that are not persistent
static void confirmJavXIsRunning()
          Establishes a connection to the ProvideX host, I.E.
static boolean connectionWasDropped()
          True if the connection with ProvideX has been dropped
static void freeEvent(PvxEvent event)
          Notify Eclipse that ProvideX has finish processing the event and if the EventManager is the guiManager then frees the event
 java.lang.String getAllocatedObjectList()
           
static java.awt.Component getClientGUIComponent()
           
static PluginConnectionControl getConCon()
           
static java.util.Hashtable getExtClassPrefs()
           
static java.util.ArrayList getExtCommands()
           
static EventManager getInstance()
           
static org.eclipse.core.runtime.IProgressMonitor getMonitor()
           
static java.lang.String getPvxHelperPath()
          Returns the path to the directory containing the ProvideX helper programs
static java.lang.String getRunningPvxExecutable()
           
static boolean handleEvent(boolean block, java.lang.String eventName, java.lang.String detail, java.util.Properties buildProps)
          Sends a PvxEvent to the ProvideX EventManager.
 void initConnection(PluginConnectionControl initCon)
           
static boolean isBlocking()
          True if Eclipse is waiting for ProvideX to complete processing and event
static boolean isEclipseShutingDown()
           
static boolean isEventManagerWaiting()
           
static boolean isPvxReady()
           
static boolean javXWasStarted()
          Returns true if a connection to the ProvideX EventManager was previously established
static void notifyEclipse(java.lang.String eventName, java.lang.String status, java.lang.String responseArguments)
           
 void removeListener(java.lang.String eventName)
          Removes a listener from the EventManager.
static void removePervasiveObject(int ocxId)
          Most Java objects instantiated by ProvideX will be dropped after every event.
static void runProgramInView(java.lang.String javXArgs)
           
static void setConCon(PluginConnectionControl conCon)
           
static void setContinueWaiting(boolean sw)
           
static void setEclipseBye(boolean eclipseBye)
           
static void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
           
static void setPvxReady(boolean isPvxReady)
          Notify Eclipse that ProvideX is ready to receive events
static void setRunningPvxExecutable(java.lang.String runningPvxExecutable)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pervasiveHandles

public static java.util.Vector<java.lang.Integer> pervasiveHandles

ECLIPSE_SHUTDOWN

public static final java.lang.String ECLIPSE_SHUTDOWN
See Also:
Constant Field Values

HOST_IS_READY

public static final java.lang.String HOST_IS_READY
See Also:
Constant Field Values

EXT_EVENT

public static final java.lang.String EXT_EVENT
See Also:
Constant Field Values

ADDING_RESOURCES_TO_SRC

public static final java.lang.String ADDING_RESOURCES_TO_SRC
See Also:
Constant Field Values

REMOVED_RESOURCE_FROM_SRC

public static final java.lang.String REMOVED_RESOURCE_FROM_SRC
See Also:
Constant Field Values

FULL_BUILD

public static final java.lang.String FULL_BUILD
See Also:
Constant Field Values

INCREMENTAL_BUILD

public static final java.lang.String INCREMENTAL_BUILD
See Also:
Constant Field Values

INCREMENTAL_BUILD_ALT_EXE

public static final java.lang.String INCREMENTAL_BUILD_ALT_EXE
See Also:
Constant Field Values

FULL_BUILD_ALT_EXE

public static final java.lang.String FULL_BUILD_ALT_EXE
See Also:
Constant Field Values

LIB_SCAN

public static final java.lang.String LIB_SCAN
See Also:
Constant Field Values

IOLIST_SCAN

public static final java.lang.String IOLIST_SCAN
See Also:
Constant Field Values

STRIP_LINE_NO

public static final java.lang.String STRIP_LINE_NO
See Also:
Constant Field Values

BUILDTYPE_STRIPLINES_PREP

public static final java.lang.String BUILDTYPE_STRIPLINES_PREP
See Also:
Constant Field Values

APPLY_IT_FORMAT

public static final java.lang.String APPLY_IT_FORMAT
See Also:
Constant Field Values

IMPORT_EXPORT_PROPERTIES

public static final java.lang.String IMPORT_EXPORT_PROPERTIES
See Also:
Constant Field Values

IMPORT_EXPORT_FILE

public static final java.lang.String IMPORT_EXPORT_FILE
See Also:
Constant Field Values

EXPORT

public static final java.lang.String EXPORT
See Also:
Constant Field Values

IMPORT

public static final java.lang.String IMPORT
See Also:
Constant Field Values

PROJECT_LIST

public static final java.lang.String PROJECT_LIST
See Also:
Constant Field Values

RESOURCE_PROPERTIES_CHANGED

public static final java.lang.String RESOURCE_PROPERTIES_CHANGED
See Also:
Constant Field Values

RESOURCE_LIST

public static final java.lang.String RESOURCE_LIST
See Also:
Constant Field Values

PREFERENCE_PAGE_BUTTON

public static final java.lang.String PREFERENCE_PAGE_BUTTON
See Also:
Constant Field Values

PREFERENCE_PAGE_ID

public static final java.lang.String PREFERENCE_PAGE_ID
See Also:
Constant Field Values

PREFERENCE_CHANGE

public static final java.lang.String PREFERENCE_CHANGE
See Also:
Constant Field Values

PREFERENCE_NEW_VALUE

public static final java.lang.String PREFERENCE_NEW_VALUE
See Also:
Constant Field Values

PREFERENCE_OLD_VALUE

public static final java.lang.String PREFERENCE_OLD_VALUE
See Also:
Constant Field Values

PREFERENCE_PROPERTY

public static final java.lang.String PREFERENCE_PROPERTY
See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
See Also:
Constant Field Values

RUN_IT

public static final java.lang.String RUN_IT
See Also:
Constant Field Values

RUN_DICTMAINT

public static final java.lang.String RUN_DICTMAINT
See Also:
Constant Field Values

RUN_DICT_DATA_CLASS

public static final java.lang.String RUN_DICT_DATA_CLASS
See Also:
Constant Field Values

RUN_DESIGNER

public static final java.lang.String RUN_DESIGNER
See Also:
Constant Field Values

RUN_NOMADS

public static final java.lang.String RUN_NOMADS
See Also:
Constant Field Values

RUN_TEST_PANEL

public static final java.lang.String RUN_TEST_PANEL
See Also:
Constant Field Values

RUN_CONSOLE

public static final java.lang.String RUN_CONSOLE
See Also:
Constant Field Values

RUN_HOST

public static final java.lang.String RUN_HOST
See Also:
Constant Field Values

EVENT_FIRED

public static final java.lang.String EVENT_FIRED
See Also:
Constant Field Values

FULL_BUILD_START

public static final java.lang.String FULL_BUILD_START
See Also:
Constant Field Values

FULL_BUILD_END

public static final java.lang.String FULL_BUILD_END
See Also:
Constant Field Values

IMPORTING_START

public static final java.lang.String IMPORTING_START
See Also:
Constant Field Values

IMPORTING_END

public static final java.lang.String IMPORTING_END
See Also:
Constant Field Values

OPERATION_CANCEL

public static final java.lang.String OPERATION_CANCEL
See Also:
Constant Field Values

OPERATION_ERROR

public static final java.lang.String OPERATION_ERROR
See Also:
Constant Field Values

OPERATION_SUCCESS

public static final java.lang.String OPERATION_SUCCESS
See Also:
Constant Field Values

OPERATION_REDO

public static final java.lang.String OPERATION_REDO
See Also:
Constant Field Values

LOAD

public static final java.lang.String LOAD
See Also:
Constant Field Values

REMOVE

public static final java.lang.String REMOVE
See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

PATH

public static final java.lang.String PATH
See Also:
Constant Field Values

PROJECT_INI_FILE

public static final java.lang.String PROJECT_INI_FILE
See Also:
Constant Field Values

EVENT_LISTNR

public static final java.lang.String EVENT_LISTNR
See Also:
Constant Field Values

PROJECT_NAME

public static final java.lang.String PROJECT_NAME
See Also:
Constant Field Values

PROJECT_LOCATION

public static final java.lang.String PROJECT_LOCATION
See Also:
Constant Field Values

PROJECT_MEMBER_COUNT

public static final java.lang.String PROJECT_MEMBER_COUNT
See Also:
Constant Field Values

BUILDER_EXE

public static final java.lang.String BUILDER_EXE
See Also:
Constant Field Values

VALIDATE

public static final java.lang.String VALIDATE
See Also:
Constant Field Values

VALID

public static final java.lang.String VALID
See Also:
Constant Field Values

INVALID

public static final java.lang.String INVALID
See Also:
Constant Field Values

NOMADS_BLOCKING

public static final java.lang.String NOMADS_BLOCKING
See Also:
Constant Field Values

NOMADS_NON_BLOCKING

public static final java.lang.String NOMADS_NON_BLOCKING
See Also:
Constant Field Values

REQUEST_SOCKET

public static final java.lang.Object REQUEST_SOCKET
Method Detail

getInstance

public static EventManager getInstance()

addListener

public void addListener(java.lang.String eventName)
Adds a listener to the EventManager. The EventManager will send a PvxEvent to the host every time the specified event occurs

Parameters:
eventName - 1. The eventName to be added

addListener

public void addListener(java.lang.String eventName,
                        int ctlValue)
Adds a listener to the EventManager. The EventManager This method will cause ctlvalues to be sent to the host every time the specified event occurs. The addListener(String eventName) is the preferred mehtod to register a listener because listeners registering via this method cannot block or pass values then when the specified event occurs

Parameters:
eventName - 1. String the EventName to be added
ctlValue - 2. int ctlValue to send when the specified event occurs

removeListener

public void removeListener(java.lang.String eventName)
Removes a listener from the EventManager. The EventManager will stop sending a PvxEvent to the host every time the specified event occurs


javXWasStarted

public static boolean javXWasStarted()
Returns true if a connection to the ProvideX EventManager was previously established

Returns:
boolean indicating true or false

confirmJavXIsRunning

public static void confirmJavXIsRunning()
Establishes a connection to the ProvideX host, I.E. Runs The PvxHost program, launches the ProvideX EventManager, and establishes a tcp/ip connection between Eclipse and ProvideX


handleEvent

public static boolean handleEvent(boolean block,
                                  java.lang.String eventName,
                                  java.lang.String detail,
                                  java.util.Properties buildProps)
Sends a PvxEvent to the ProvideX EventManager. This method creates, blocks Threads as required and notifies ProvideX an Event has occurred

Parameters:
block - 1 boolean. Indicates Eclipse must wait for a response from ProvideX prior to continuing
eventName - 2 String. The name of the event that has occurred. there are no listeners registered for this event this method simply returns
detail - 3 String. The minor code for this event
buildProps - 4 Properties . The minor code for this event

connectionWasDropped

public static boolean connectionWasDropped()
True if the connection with ProvideX has been dropped

Returns:
true if the connection with ProvideX has been dropped

freeEvent

public static void freeEvent(PvxEvent event)
Notify Eclipse that ProvideX has finish processing the event and if the EventManager is the guiManager then frees the event


addPervasiveObject

public static void addPervasiveObject(int ocxId)
Most Java objects instantiated by ProvideX are dropped after every event. Pervasive (persistent) objects should persist and will only be dropped via the ProvideX DROP OBJECT directive

Parameters:
ocxId - int. The object handle to make persistent
See Also:
removePervasiveObject(int)

removePervasiveObject

public static void removePervasiveObject(int ocxId)
Most Java objects instantiated by ProvideX will be dropped after every event. Pervasive (persistent) objects should persist and will only be dropped via the ProvideX DROP OBJECT directive

Parameters:
ocxId - int. The object handle to remove from the list of persistent objects
See Also:
addPervasiveObject(int)

collectGarbage

public static void collectGarbage()
Cleans up all objects that are not persistent

See Also:
addPervasiveObject(int), removePervasiveObject(int)

isBlocking

public static boolean isBlocking()
True if Eclipse is waiting for ProvideX to complete processing and event

Returns:
true if Eclipse is waiting for ProvideX to complete processing and event

clearAllBlocks

public static void clearAllBlocks()
Frees all blocking PvxEvents


initConnection

public void initConnection(PluginConnectionControl initCon)

getClientGUIComponent

public static java.awt.Component getClientGUIComponent()

setConCon

public static void setConCon(PluginConnectionControl conCon)

getConCon

public static PluginConnectionControl getConCon()

getPvxHelperPath

public static java.lang.String getPvxHelperPath()
Returns the path to the directory containing the ProvideX helper programs

Returns:
The path to the directory containing the ProvideX helper programs

bye

public static final void bye()

notifyEclipse

public static void notifyEclipse(java.lang.String eventName,
                                 java.lang.String status,
                                 java.lang.String responseArguments)

setEclipseBye

public static void setEclipseBye(boolean eclipseBye)

isEclipseShutingDown

public static boolean isEclipseShutingDown()

setPvxReady

public static void setPvxReady(boolean isPvxReady)
Notify Eclipse that ProvideX is ready to receive events

Parameters:
isPvxReady - true if ProvideX is ready

isPvxReady

public static boolean isPvxReady()

setContinueWaiting

public static void setContinueWaiting(boolean sw)

isEventManagerWaiting

public static boolean isEventManagerWaiting()

setMonitor

public static void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)

getMonitor

public static org.eclipse.core.runtime.IProgressMonitor getMonitor()

getAllocatedObjectList

public java.lang.String getAllocatedObjectList()

setRunningPvxExecutable

public static void setRunningPvxExecutable(java.lang.String runningPvxExecutable)

getRunningPvxExecutable

public static java.lang.String getRunningPvxExecutable()

addToPrefPages

public void addToPrefPages(java.lang.String key,
                           java.lang.String value)
Adds the specified key to an Eclipse Preference page

Parameters:
key -
value -

getExtClassPrefs

public static java.util.Hashtable getExtClassPrefs()

addExtPvxEventListener

public static void addExtPvxEventListener(int listener,
                                          java.lang.String commandStr)
Adds an AbstractActionListener

Parameters:
listener - -The actionPerformed function of the listener will be called
commandStr - -String will appear in the Contributed Tools list

addExtJavaEventListener

public static void addExtJavaEventListener(java.lang.Object listener,
                                           java.lang.String commandStr,
                                           boolean notifyEvtMngr)
Adds an AbstractActionListener.

Parameters:
listener - -The actionPerformed function of the listener will be called
commandStr - -String will appear in the Contributed Tools list
notifyEvtMngr - -True if ProvideX should be informed the action occurred.

getExtCommands

public static java.util.ArrayList getExtCommands()

runProgramInView

public static void runProgramInView(java.lang.String javXArgs)