cz.cuni.pogamut.posh.explorer
Interface IExplorerActions<T>

Package class diagram package IExplorerActions

public interface IExplorerActions<T>

Interface for actions that can be performed on the Explorer.

Author:
Honza

Method Summary
 Transferable createNewTransferable()
          Create Transferable that is used when user drags and drops node representing new item somewhere (presumably to scene).
 Transferable createTransferable(T data)
          Create new Transferable from item data.
 boolean delete(T item)
          Delete item (e.g.
 boolean filter(String query, boolean caseSensitive, T item)
          Method to filter items in the Explorer.
 String getDescription(T item)
          Get description of an item (to be used in the tootltip text).
 String getDisplayName(T item)
          Get text for @item that will be displayed in the explorer.
 String getNewItemLabel()
          Get label for new item action.
 void openEditor(T item)
          Open editor for item.
 void refresh(Explorer<T> explorer)
          Refresh the explorer.
 

Method Detail

getDisplayName

String getDisplayName(T item)
Get text for @item that will be displayed in the explorer.

Parameters:
item - Item that has survived filtration.
Returns:
name of the item to be displayed in the list.

getNewItemLabel

String getNewItemLabel()
Get label for new item action.

Returns:
String to be shown as first item in the list, basically synonym for add new item action.

getDescription

String getDescription(T item)
Get description of an item (to be used in the tootltip text).

Parameters:
item - Item in the result list
Returns:
tooltip thaty should be shown when user hovers over the item.

filter

boolean filter(String query,
               boolean caseSensitive,
               T item)
Method to filter items in the Explorer. Whe user types something into search box, explorer uses some implementation of this filter to determine which items should be shown in the result window.

Parameters:
query - String query, what user typed into search window
caseSensitive - Should the filtering be case sensitive?
item - Item that will be evaluated if it should be filtered out or not
Returns:
True if item should not be included (i.e. it should be filtered out) False if item should be included (shown in the result)

refresh

void refresh(Explorer<T> explorer)
Refresh the explorer.


delete

boolean delete(T item)
Delete item (e.g. Competence) from the plan, that may include some questions to the user ("Are you sure?") .

Parameters:
item - Item to be deleted.
Returns:
Was item deleted? User could abort, file trouble...

openEditor

void openEditor(T item)
Open editor for item.

Parameters:
item - Item to be displayed

createTransferable

Transferable createTransferable(T data)
Create new Transferable from item data. Used in the explorer for Drag and drop operation.

Parameters:
data - data that will be transfered, can be null
Returns:
new transferable or null if data isn't suitable for transfer.

createNewTransferable

Transferable createNewTransferable()
Create Transferable that is used when user drags and drops node representing new item somewhere (presumably to scene). When the transferable is asked for data, it queries the user for the data and returns new item.



Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.