Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.debug.internal.ui.launchConfigurations
Class LaunchHistory  view LaunchHistory download LaunchHistory.java

java.lang.Object
  extended byorg.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory
All Implemented Interfaces:
org.eclipse.debug.core.ILaunchConfigurationListener, org.eclipse.debug.core.ILaunchListener

public class LaunchHistory
extends java.lang.Object
implements org.eclipse.debug.core.ILaunchListener, org.eclipse.debug.core.ILaunchConfigurationListener

A history of launches and favorites for a launch group


Field Summary
private  boolean fDirty
           
private  java.util.List fFavorites
           
private  org.eclipse.debug.ui.ILaunchGroup fGroup
           
private  java.util.List fHistory
           
private  org.eclipse.debug.core.ILaunchConfiguration fRecentLaunch
           
private static java.util.List launchHistoryInstances
           
 
Constructor Summary
LaunchHistory(org.eclipse.debug.ui.ILaunchGroup group)
          Creates a new launch history for the given launch group
 
Method Summary
 boolean accepts(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Returns whether the given configruation is included in the group associated with this launch history.
 void addFavorite(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Adds the given configuration to the favorites list.
protected  void addHistory(org.eclipse.debug.core.ILaunchConfiguration configuration, boolean prepend)
          Adds the givev configuration to this hisotry
protected  boolean checkIfFavorite(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Adds the given config to the favorites list if it is a favorite, and returns whether the config was added to the favorites list.
private  void clearDirty()
          Clears the dirty flag
 void dispose()
          Disposes this history
 org.eclipse.debug.core.ILaunchConfiguration[] getFavorites()
          Returns the favorite launch configurations in this history, in the order they were created.
 org.eclipse.debug.core.ILaunchConfiguration[] getHistory()
          Returns the launch configuration in this history, in most recently launched order.
 org.eclipse.debug.ui.ILaunchGroup getLaunchGroup()
          Returns the launch group associated with this history
protected  int getMaxHistorySize()
          Returns the maximum number of entries allowed in this history
 org.eclipse.debug.core.ILaunchConfiguration getRecentLaunch()
          Returns the most recently launched configuration in this history, or null if none.
private  boolean isDirty()
          Returns the dirty state
 void launchAdded(org.eclipse.debug.core.ILaunch launch)
          Notifies this listener that the specified launch has been added.
 void launchChanged(org.eclipse.debug.core.ILaunch launch)
          Notifies this listener that the specified launch has changed.
 void launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration configuration)
          The given launch configuration has been created.
 void launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration configuration)
          The given launch configuration has changed in some way.
 void launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration configuration)
          The given launch configuration has been deleted.
static void launchHistoryChanged()
          Notifies all launch histories that the launch history size has changed.
 void launchRemoved(org.eclipse.debug.core.ILaunch launch)
          Notifies this listener that the specified launch has been removed.
protected  void removeFavorite(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Revmoves the given config from the favorites list, if needed.
protected  void resizeHistory()
          The max history size has changed - remove any histories if current collection is too long.
private  void save()
          Saves if dirty
private  void setDirty()
          Sets the dirty flag
 void setFavorites(org.eclipse.debug.core.ILaunchConfiguration[] favorites)
          Sets this container's favorites.
 void setHistory(org.eclipse.debug.core.ILaunchConfiguration[] history)
          Sets this container's launch history.
protected  void setRecentLaunch(org.eclipse.debug.core.ILaunchConfiguration configuration)
          Sets the most recently launched configuration in this history, or null if none.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fGroup

private org.eclipse.debug.ui.ILaunchGroup fGroup

fHistory

private java.util.List fHistory

fFavorites

private java.util.List fFavorites

fDirty

private boolean fDirty

fRecentLaunch

private org.eclipse.debug.core.ILaunchConfiguration fRecentLaunch

launchHistoryInstances

private static java.util.List launchHistoryInstances
Constructor Detail

LaunchHistory

public LaunchHistory(org.eclipse.debug.ui.ILaunchGroup group)
Creates a new launch history for the given launch group

Method Detail

dispose

public void dispose()
Disposes this history


launchAdded

public void launchAdded(org.eclipse.debug.core.ILaunch launch)
Description copied from interface: org.eclipse.debug.core.ILaunchListener
Notifies this listener that the specified launch has been added.

Specified by:
launchAdded in interface org.eclipse.debug.core.ILaunchListener

addHistory

protected void addHistory(org.eclipse.debug.core.ILaunchConfiguration configuration,
                          boolean prepend)
Adds the givev configuration to this hisotry


save

private void save()
Saves if dirty


clearDirty

private void clearDirty()
Clears the dirty flag


setDirty

private void setDirty()
Sets the dirty flag


isDirty

private boolean isDirty()
Returns the dirty state


launchChanged

public void launchChanged(org.eclipse.debug.core.ILaunch launch)
Description copied from interface: org.eclipse.debug.core.ILaunchListener
Notifies this listener that the specified launch has changed. For example, a process or debug target has been added to the launch.

Specified by:
launchChanged in interface org.eclipse.debug.core.ILaunchListener

launchRemoved

public void launchRemoved(org.eclipse.debug.core.ILaunch launch)
Description copied from interface: org.eclipse.debug.core.ILaunchListener
Notifies this listener that the specified launch has been removed.

Specified by:
launchRemoved in interface org.eclipse.debug.core.ILaunchListener

getRecentLaunch

public org.eclipse.debug.core.ILaunchConfiguration getRecentLaunch()
Returns the most recently launched configuration in this history, or null if none.


setRecentLaunch

protected void setRecentLaunch(org.eclipse.debug.core.ILaunchConfiguration configuration)
Sets the most recently launched configuration in this history, or null if none.


getHistory

public org.eclipse.debug.core.ILaunchConfiguration[] getHistory()
Returns the launch configuration in this history, in most recently launched order.


getFavorites

public org.eclipse.debug.core.ILaunchConfiguration[] getFavorites()
Returns the favorite launch configurations in this history, in the order they were created.


setHistory

public void setHistory(org.eclipse.debug.core.ILaunchConfiguration[] history)
Sets this container's launch history.


setFavorites

public void setFavorites(org.eclipse.debug.core.ILaunchConfiguration[] favorites)
Sets this container's favorites.


addFavorite

public void addFavorite(org.eclipse.debug.core.ILaunchConfiguration configuration)
Adds the given configuration to the favorites list.


getLaunchGroup

public org.eclipse.debug.ui.ILaunchGroup getLaunchGroup()
Returns the launch group associated with this history


accepts

public boolean accepts(org.eclipse.debug.core.ILaunchConfiguration configuration)
Returns whether the given configruation is included in the group associated with this launch history.


launchHistoryChanged

public static void launchHistoryChanged()
Notifies all launch histories that the launch history size has changed.


resizeHistory

protected void resizeHistory()
The max history size has changed - remove any histories if current collection is too long.


getMaxHistorySize

protected int getMaxHistorySize()
Returns the maximum number of entries allowed in this history


launchConfigurationAdded

public void launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration configuration)
Description copied from interface: org.eclipse.debug.core.ILaunchConfigurationListener
The given launch configuration has been created.

Specified by:
launchConfigurationAdded in interface org.eclipse.debug.core.ILaunchConfigurationListener

checkIfFavorite

protected boolean checkIfFavorite(org.eclipse.debug.core.ILaunchConfiguration configuration)
Adds the given config to the favorites list if it is a favorite, and returns whether the config was added to the favorites list.


removeFavorite

protected void removeFavorite(org.eclipse.debug.core.ILaunchConfiguration configuration)
Revmoves the given config from the favorites list, if needed.


launchConfigurationChanged

public void launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration configuration)
Description copied from interface: org.eclipse.debug.core.ILaunchConfigurationListener
The given launch configuration has changed in some way. The configuration may be a working copy.

Specified by:
launchConfigurationChanged in interface org.eclipse.debug.core.ILaunchConfigurationListener

launchConfigurationRemoved

public void launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration configuration)
Description copied from interface: org.eclipse.debug.core.ILaunchConfigurationListener
The given launch configuration has been deleted.

Specified by:
launchConfigurationRemoved in interface org.eclipse.debug.core.ILaunchConfigurationListener