Package org.eclipse.jface.util
Class OpenStrategy
java.lang.Object
org.eclipse.jface.util.OpenStrategy
Implementation of single-click and double-click strategies.
 
Usage:
        OpenStrategy handler = new OpenStrategy(control);
        handler.addOpenListener(new IOpenEventListener() {
                public void handleOpen(SelectionEvent e) {
                        ... // code to handle the open event.
                }
        });
 - 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intOpen item when using arrow keysstatic final intDefault behavior.static final intDeprecated.static final intDeprecated.static final intHover will select the item.static final intSingle click will open the item.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic booleanvoidaddOpenListener(IOpenEventListener listener) Adds an IOpenEventListener to the collection of openEventListenersvoidaddPostSelectionListener(SelectionListener listener) Adds an SelectionListener to the collection of selectionEventListenersvoidaddSelectionListener(SelectionListener listener) Adds an SelectionListener to the collection of selectionEventListenersstatic intThis method is internal to the framework; it should not be implemented outside the framework.static final intReturns the delay for post selection events.voidremoveOpenListener(IOpenEventListener listener) Removes an IOpenEventListener to the collection of openEventListenersvoidremovePostSelectionListener(SelectionListener listener) Removes an SelectionListener to the collection of selectionEventListenersvoidremoveSelectionListener(SelectionListener listener) Removes an SelectionListener to the collection of selectionEventListenersstatic voidsetOpenMethod(int method) Set the current used single/double-click method.
- 
Field Details- 
DOUBLE_CLICKpublic static final int DOUBLE_CLICKDefault behavior. Double click to open the item.- See Also:
 
- 
SINGLE_CLICKpublic static final int SINGLE_CLICKSingle click will open the item.- See Also:
 
- 
SELECT_ON_HOVERpublic static final int SELECT_ON_HOVERHover will select the item.- See Also:
 
- 
ARROW_KEYS_OPENpublic static final int ARROW_KEYS_OPENOpen item when using arrow keys- See Also:
 
- 
NO_TIMERDeprecated.A single click will generate an open event but key arrows will not do anything.- See Also:
 
- 
FILE_EXPLORERDeprecated.A single click will generate an open event and key arrows will generate an open event after a small time.- See Also:
 
- 
ACTIVE_DESKTOPDeprecated.Pointing to an item will change the selection and a single click will gererate an open event- See Also:
 
 
- 
- 
Constructor Details- 
OpenStrategy- Parameters:
- control- the control the strategy is applied to
 
 
- 
- 
Method Details- 
getPostSelectionDelaypublic static final int getPostSelectionDelay()Returns the delay for post selection events.- Returns:
- the delay for post selection events in milliseconds
- Since:
- 3.7
 
- 
addOpenListenerAdds an IOpenEventListener to the collection of openEventListeners- Parameters:
- listener- the listener to add
 
- 
removeOpenListenerRemoves an IOpenEventListener to the collection of openEventListeners- Parameters:
- listener- the listener to remove
 
- 
addSelectionListenerAdds an SelectionListener to the collection of selectionEventListeners- Parameters:
- listener- the listener to add
 
- 
removeSelectionListenerRemoves an SelectionListener to the collection of selectionEventListeners- Parameters:
- listener- the listener to remove
 
- 
addPostSelectionListenerAdds an SelectionListener to the collection of selectionEventListeners- Parameters:
- listener- the listener to add
 
- 
removePostSelectionListenerRemoves an SelectionListener to the collection of selectionEventListeners- Parameters:
- listener- the listener to remove
 
- 
getOpenMethodpublic static int getOpenMethod()This method is internal to the framework; it should not be implemented outside the framework.- Returns:
- the current used single/double-click method
 
- 
setOpenMethodpublic static void setOpenMethod(int method) Set the current used single/double-click method. This method is internal to the framework; it should not be implemented outside the framework.- Parameters:
- method- the method to be used
- See Also:
 
- 
activateOnOpenpublic static boolean activateOnOpen()- Returns:
- true if editors should be activated when opened.
 
 
-