org.openpermis.editor.policy.view
Class RecentFilesTool

java.lang.Object
  extended by org.openpermis.editor.policy.view.AbstractView
      extended by org.openpermis.editor.policy.view.AbstractToolView<RecentFilesPresenter>
          extended by org.openpermis.editor.policy.view.RecentFilesTool
All Implemented Interfaces:
PropertyChangeListener, EventListener, org.jdesktop.observablecollections.ObservableListListener, ErrorReporter, Tool, View

public class RecentFilesTool
extends AbstractToolView<RecentFilesPresenter>
implements PropertyChangeListener, org.jdesktop.observablecollections.ObservableListListener

Tool showing recently opened files.

Since:
0.1.0

Nested Class Summary
private  class RecentFilesTool.Renderer
          Renderer for recent files list.
 
Field Summary
private  JList list
          Renderer for the recent file list.
private  PolicyLoader loader
          The actual loader for policies.
private static bibliothek.gui.dock.common.CLocation LOCATION
          The default location for this tool.
private static org.slf4j.Logger LOGGER
          The logger object of this class.
 
Fields inherited from class org.openpermis.editor.policy.view.AbstractToolView
DEFAULT_LOCATION
 
Constructor Summary
RecentFilesTool(org.jdesktop.application.ApplicationContext context, AdapterTrader trader, PolicyLoader loader, RecentFilesPresenter presenter)
          Creates a new recent files tool.
 
Method Summary
protected  void attachPresenter(RecentFilesPresenter presenter, org.jdesktop.beansbinding.BindingGroup bindings)
          Attaches any listeners required to the new presenter and binds components.
 void clearFiles()
           
 JComponent createContentPane()
          Creates the content pane of this view.
 void deleteSelectedFile()
           
protected  void detachPresenter(RecentFilesPresenter presenter)
          Unlinks any listeners from the specified old presenter.
 bibliothek.gui.dock.common.CLocation getDefaultLocation()
          Returns the desired default location relative to the working area for this tool view.
 void listElementPropertyChanged(org.jdesktop.observablecollections.ObservableList fileList, int index)
           
 void listElementReplaced(org.jdesktop.observablecollections.ObservableList fileList, int index, Object oldElement)
           
 void listElementsAdded(org.jdesktop.observablecollections.ObservableList fileList, int index, int length)
           
 void listElementsRemoved(org.jdesktop.observablecollections.ObservableList fileList, int index, List oldElements)
           
 void openOtherFile()
           
 void openSelectedFile()
           
 void propertyChange(PropertyChangeEvent event)
           
 void refresh(org.openpermis.policy.bean.PolicyBean policy, PolicyContext context)
          Instructs the tool to refresh itself with the specified policy.
protected  void updateActions()
          Prompts the tool to update its actions according to the presenter state.
 
Methods inherited from class org.openpermis.editor.policy.view.AbstractToolView
contentPaneCreated, createToolBar, getPresenter, getToolBar, getToolIdentifier, setPresenter
 
Methods inherited from class org.openpermis.editor.policy.view.AbstractView
attach, canClose, canEditPart, closeView, detach, editPart, getActionMap, getAdapteeTrader, getContentPane, getIcon, getResourceMap, getTitle, getTitleParameters, getViewContext, label, openView, showStatusError, toolBar, updateTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openpermis.editor.policy.view.View
attach, canClose, detach, getContentPane, getIcon, getTitle
 

Field Detail

LOGGER

private static final org.slf4j.Logger LOGGER
The logger object of this class.

Since:
0.1.0

LOCATION

private static final bibliothek.gui.dock.common.CLocation LOCATION
The default location for this tool.

Since:
0.1.0

loader

private final PolicyLoader loader
The actual loader for policies.

Since:
0.1.0

list

private JList list
Renderer for the recent file list.

Since:
0.1.0
Constructor Detail

RecentFilesTool

public RecentFilesTool(org.jdesktop.application.ApplicationContext context,
                       AdapterTrader trader,
                       PolicyLoader loader,
                       RecentFilesPresenter presenter)
Creates a new recent files tool.

Parameters:
context - the application context to retrieve resources from.
loader - the loader for policies.
presenter - the presenter of this tool.
Since:
0.1.0
Method Detail

openOtherFile

@Action
public void openOtherFile()
Since:
0.1.0

deleteSelectedFile

@Action
public void deleteSelectedFile()
Since:
0.1.0

openSelectedFile

@Action
public void openSelectedFile()
Since:
0.1.0

clearFiles

@Action
public void clearFiles()
Since:
0.1.0

updateActions

protected void updateActions()
Description copied from class: AbstractToolView
Prompts the tool to update its actions according to the presenter state.

The default implementation does nothing.

Overrides:
updateActions in class AbstractToolView<RecentFilesPresenter>
Since:
0.1.0

attachPresenter

protected void attachPresenter(RecentFilesPresenter presenter,
                               org.jdesktop.beansbinding.BindingGroup bindings)
Description copied from class: AbstractToolView
Attaches any listeners required to the new presenter and binds components.

The default implementation initializes the content pane if necessary.

Overrides:
attachPresenter in class AbstractToolView<RecentFilesPresenter>
Parameters:
presenter - the new presenter to attach to.
bindings - the binding group to add bindings to.
Since:
0.1.0

detachPresenter

protected void detachPresenter(RecentFilesPresenter presenter)
Description copied from class: AbstractToolView
Unlinks any listeners from the specified old presenter.

This is called before a new presenter is set.

The default implementation removes any bean bindings.

Overrides:
detachPresenter in class AbstractToolView<RecentFilesPresenter>
Parameters:
presenter - the presenter to unlink.
See Also:
AbstractToolView.setPresenter(Presenter)
Since:
0.1.0

refresh

public void refresh(org.openpermis.policy.bean.PolicyBean policy,
                    PolicyContext context)
Description copied from interface: Tool
Instructs the tool to refresh itself with the specified policy.

Called whenever the policy that this view renders changes.

Specified by:
refresh in interface Tool
Parameters:
policy - the policy to refresh with.
context - the policy context to use.
Since:
0.1.0

getDefaultLocation

public bibliothek.gui.dock.common.CLocation getDefaultLocation()
Description copied from interface: Tool
Returns the desired default location relative to the working area for this tool view.

Specified by:
getDefaultLocation in interface Tool
Overrides:
getDefaultLocation in class AbstractToolView<RecentFilesPresenter>
Returns:
the desired default location of this tool view.
Since:
0.1.0

createContentPane

public JComponent createContentPane()
Description copied from class: AbstractView
Creates the content pane of this view.

Specified by:
createContentPane in class AbstractView
Returns:
the content pane of this view, must not be null.
Since:
0.1.0

propertyChange

public void propertyChange(PropertyChangeEvent event)
Specified by:
propertyChange in interface PropertyChangeListener
Since:
0.1.0

listElementPropertyChanged

public void listElementPropertyChanged(org.jdesktop.observablecollections.ObservableList fileList,
                                       int index)
Specified by:
listElementPropertyChanged in interface org.jdesktop.observablecollections.ObservableListListener
Since:
0.1.0

listElementReplaced

public void listElementReplaced(org.jdesktop.observablecollections.ObservableList fileList,
                                int index,
                                Object oldElement)
Specified by:
listElementReplaced in interface org.jdesktop.observablecollections.ObservableListListener
Since:
0.1.0

listElementsAdded

public void listElementsAdded(org.jdesktop.observablecollections.ObservableList fileList,
                              int index,
                              int length)
Specified by:
listElementsAdded in interface org.jdesktop.observablecollections.ObservableListListener
Since:
0.1.0

listElementsRemoved

public void listElementsRemoved(org.jdesktop.observablecollections.ObservableList fileList,
                                int index,
                                List oldElements)
Specified by:
listElementsRemoved in interface org.jdesktop.observablecollections.ObservableListListener
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG