Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui
Class SelectionEnabler

java.lang.Object
  extended by 
org.eclipse.ui.SelectionEnabler

public final class SelectionEnabler
extends Object

Determines the enablement status given a selection. This calculation is done based on the definition of the enablesFor attribute, enablement element, and the selection element found in the IConfigurationElement provided.

This class can be instantiated by clients. It is not intended to be extended.

Since:
3.0 Note: The dependency on org.eclipse.jface.text for ITextSelection must be severed It may be possible to do with IActionFilter generic workbench registers IActionFilter for "size" property against IStructuredSelection workbench text registers IActionFilter for "size" property against ITextSelection code here: sel.getAdapter(IActionFilter.class) As an interim solution, use reflection to access selections implementing ITextSelection

Field Summary
static int ANY_NUMBER
           
static int MULTIPLE
           
static int NONE
           
static int NONE_OR_ONE
           
static int ONE_OR_MORE
           
static int UNKNOWN
           
 
Constructor Summary
SelectionEnabler ( IConfigurationElement configElement)
          Create a new instance of the receiver.
 
Method Summary
 boolean equals ( Object object)
           
 int hashCode ()
          Computes the hash code for this object based on the id.
 boolean isEnabledForSelection ( ISelection selection)
          Check if the receiver is enabled for the given selection.
static boolean verifyNameMatch ( String name, String filter)
          Verifies that the given name matches the given wildcard filter.
 
Methods inherited from class java.lang. Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY_NUMBER

public static final int ANY_NUMBER
See Also:
Constant Field Values

MULTIPLE

public static final int MULTIPLE
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

NONE_OR_ONE

public static final int NONE_OR_ONE
See Also:
Constant Field Values

ONE_OR_MORE

public static final int ONE_OR_MORE
See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values
Constructor Detail

SelectionEnabler

public SelectionEnabler(
IConfigurationElement configElement)
Create a new instance of the receiver.

Parameters:
configElement -
Method Detail

verifyNameMatch

public static boolean verifyNameMatch(
String name,
                                      
String filter)
Verifies that the given name matches the given wildcard filter. Returns true if it does.

Parameters:
name -
filter -
Returns:
true if there is a match

equals

public final boolean equals(
Object object)
Overrides:
equals in class Object

hashCode

public final int hashCode()
Computes the hash code for this object based on the id.

Overrides:
hashCode in class Object
Returns:
The hash code for this object.

isEnabledForSelection

public boolean isEnabledForSelection(
ISelection selection)
Check if the receiver is enabled for the given selection.

Parameters:
selection -
Returns:
true if the given selection matches the conditions specified in IConfirgurationElement.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire