pl.edu.agh.cast
Class CastApplication

java.lang.Object
  extended by pl.edu.agh.cast.CastApplication
All Implemented Interfaces:
org.eclipse.equinox.app.IApplication, IPropertyChangeProvider

public class CastApplication
extends Object
implements org.eclipse.equinox.app.IApplication, IPropertyChangeProvider

This class controls all aspects of the application's execution.

Author:
AGH CAST Team

Field Summary
static String ID
          Bundle Id.
static String KEY_SCHEME_ID
           
static String PROPERTY_ACTIVE_PROJECT
          Id of the Active project changed property.
 
Fields inherited from interface org.eclipse.equinox.app.IApplication
EXIT_OK, EXIT_RELAUNCH, EXIT_RESTART
 
Constructor Summary
CastApplication()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
          Add a property change listener to the object.
static boolean confirmationDialog(String title, String message)
          Displays a confirmation dialog.
static void errorDialog(String title, String message)
          Displays an error dialog.
static org.eclipse.core.resources.IProject getActiveProject()
           
static String getActiveProjectLocation()
           
static org.eclipse.swt.widgets.Shell getActiveShell()
          Returns the active Shell.
static org.eclipse.swt.dnd.Clipboard getClipboard()
           
static org.eclipse.swt.widgets.Display getDisplay()
           
static IPropertyChangeProvider getPropertyChangeProvider()
           
static void informationDialog(String title, String message)
          Displays an information dialog.
static boolean questionDialog(String title, String message)
          Displays a Y/N question dialog.
 void removePropertyChangeListener(PropertyChangeListener l)
          Remove a property change listener to the object.
static void setActiveProject(org.eclipse.core.resources.IProject activeProjectArg)
          Sets new active project.
 Object start(org.eclipse.equinox.app.IApplicationContext context)
          
 void stop()
          
static void warningDialog(String title, String message)
          Displays a warning dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_ACTIVE_PROJECT

public static final String PROPERTY_ACTIVE_PROJECT
Id of the Active project changed property.

See Also:
Constant Field Values

ID

public static final String ID
Bundle Id.

See Also:
Constant Field Values

KEY_SCHEME_ID

public static final String KEY_SCHEME_ID
See Also:
Constant Field Values
Constructor Detail

CastApplication

public CastApplication()
Method Detail

getDisplay

public static org.eclipse.swt.widgets.Display getDisplay()

getClipboard

public static org.eclipse.swt.dnd.Clipboard getClipboard()

getActiveProjectLocation

public static String getActiveProjectLocation()

getActiveProject

public static org.eclipse.core.resources.IProject getActiveProject()

setActiveProject

public static void setActiveProject(org.eclipse.core.resources.IProject activeProjectArg)
Sets new active project. Note: should be used only by ApplicationWorkbenchAdvisor.

Parameters:
activeProjectArg - new active project

getActiveShell

public static org.eclipse.swt.widgets.Shell getActiveShell()
Returns the active Shell.

Returns:
the active Shell

confirmationDialog

public static boolean confirmationDialog(String title,
                                         String message)
Displays a confirmation dialog.

Parameters:
title - dialog title
message - message to confirm
Returns:
confirmation result

errorDialog

public static void errorDialog(String title,
                               String message)
Displays an error dialog.

Parameters:
title - dialog title
message - error message

warningDialog

public static void warningDialog(String title,
                                 String message)
Displays a warning dialog.

Parameters:
title - dialog title
message - warning message

informationDialog

public static void informationDialog(String title,
                                     String message)
Displays an information dialog.

Parameters:
title - dialog title
message - information message

questionDialog

public static boolean questionDialog(String title,
                                     String message)
Displays a Y/N question dialog.

Parameters:
title - dialog title
message - question to confirm
Returns:
the answer

start

public Object start(org.eclipse.equinox.app.IApplicationContext context)
             throws Exception

Specified by:
start in interface org.eclipse.equinox.app.IApplication
Throws:
Exception
See Also:
IApplication.start(org.eclipse.equinox.app.IApplicationContext)

stop

public void stop()

Specified by:
stop in interface org.eclipse.equinox.app.IApplication
See Also:
IApplication.stop()

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Add a property change listener to the object.

Specified by:
addPropertyChangeListener in interface IPropertyChangeProvider
Parameters:
l - property change listener
See Also:
IPropertyChangeProvider.addPropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Remove a property change listener to the object.

Specified by:
removePropertyChangeListener in interface IPropertyChangeProvider
Parameters:
l - property change listener
See Also:
#removePropertyChangeListener(java.beans.PropertyChangeListener)

getPropertyChangeProvider

public static IPropertyChangeProvider getPropertyChangeProvider()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.