| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
com.togethersoft.openapi.util.properties.DictionaryProperties | +--com.togethersoft.openapi.ide.command.IdeCommandConstraints
Defines the domain of applicability for the command item (IdeCommandItem or IdeCommandGroup).
IdeCommandConstraints() constructor creates an "empty" constraint object which
doesn't define any constraints for the command item.
The string in IdeCommandConstraints(String) constructor contains the constraints separated
with a comma. A constraint is a string "nameOfTheConstraint = value" pair. This class contains a set
of constants with the possible names of constraints:
context constraint (this name is defined by the CONTEXT constant)
element (defined in the ELEMENT_CONTEXT constant) - the command
file (defined in the FILE_CONTEXT constant) -
textEditor (defined in the #TEXT_EDITOR_CONTEXT
context constraint is element,
shapeType constraint (this name is defined by the SHAPE_TYPE constant)
For example,
new IdeCommandConstraints("context=element, shapeType="+RwiShapeType.CLASS)
context constraint is file
textEditor (TEXT_EDITOR_CONTEXT constant), the
fileCategory constraint (this name is defined by the FILE_CATEGORY
java_class, java_source, cpp_source, cpp_header, diagram, project, config,
text_file etc.) For example,
new IdeCommandConstraints("context=file, fileCategory=java_source, fileCategory=text_file")
new IdeCommandConstraints("context=textEditor, fileCategory=java_source")
placeBefore constraint (this name is defined by the PLACE_BEFORE constant)
placeAfter constraint (this name is defined by the PLACE_AFTER constant)
parent constraint (this name is defined by the
For example:
IdeCommandManager cman=IdeCommandManagerAccess.getCommandManager();
IdeCommandGroup myGroup=cman.createGroup("IDOfTheGroup",new IdeCommandConstraints("context = element, location=popupMenu"), new IdeCommandAdapter());
IdeCommandItem myItem=cman.createItem("IDOfTheItem",new IdeCommandConstraints("context = element, parent=IDOfTheGroup, location=popupMenu"),new IdeCommandAdapter());
location constraint (this name is defined by the LOCATION constant)
new IdeCommandConstraints("context=element, shapeType="+RwiShapeType.CLASS+", parent=IDOfTheParent, location=popupMenu")
In previous examples we directly used the values of constraints defined in this interface. Of course, it
is possible to write it in the right style (the last example):
IdeCommandContraints rightWayIsTough = new IdeCommandConstraints(IdeCommandConstraints.CONTEXT+"="+IdeCommandConstraints.ELEMENT+","+IdeCommandConstraints.SHAPE_TYPE+"="+RwiShapeType.CLASS+","+IdeCommandConstraints.PARENT+"=IDOfTheParent,"+IdeCommandConstraints.LOCATION+"="+IdeCommandConstraints.POPUP_MENU_LOCATION); // 8=)| Field Summary | |
final static String | CONTEXTThe value is "context". |
final static String | ELEMENT_CONTEXTThe value is "element". |
final static String | EXTENSIONThe value is "extension". |
final static String | FILE_CATEGORYThe value is "fileCategory". |
final static String | FILE_CONTEXTThe value is "file". |
final static String | LOCATIONThe value is "location". |
final static String | MAIN_MENU_LOCATIONThe value is "mainMenu". |
final static String | MAIN_TOOLBAR_LOCATIONThe value is "mainToolbar". |
final static String | PARENTThe value is "parent". |
final static String | PLACE_AFTERThe value is "placeAfter". |
final static String | PLACE_BEFOREThe value is "placeBefore". |
final static String | POPUP_MENU_LOCATIONThe value is "popupMenu". |
final static String | SHAPE_TYPEThe value is "shapeType". |
final static String | TEXT_EDITOR_CONTEXTThe value is "textEditor". |
| Constructor Summary | |
IdeCommandConstraints()IdeCommandConstraints() constructor creates an "empty" constraint object which
doesn't define any constraints for the command item. | |
IdeCommandConstraints(String values)Creates a constraint object. | |
| Methods inherited from class com.togethersoft.openapi.util.properties.DictionaryProperties |
addPropertyChangeListener, addVetoableChangeListener, clear, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getImplementation, getProperty, propertyNames, putProperty, removePropertyChangeListener, removeVetoableChangeListener |
| Field Detail |
public final static String CONTEXT
"context".public final static String ELEMENT_CONTEXT
"element".public final static String EXTENSION
"extension".public final static String FILE_CATEGORY
"fileCategory".public final static String FILE_CONTEXT
"file".public final static String LOCATION
"location".public final static String MAIN_MENU_LOCATION
"mainMenu".public final static String MAIN_TOOLBAR_LOCATION
"mainToolbar".public final static String PARENT
"parent".public final static String PLACE_AFTER
"placeAfter".public final static String PLACE_BEFORE
"placeBefore".public final static String POPUP_MENU_LOCATION
"popupMenu".public final static String SHAPE_TYPE
"shapeType".public final static String TEXT_EDITOR_CONTEXT
"textEditor".| Constructor Detail |
public IdeCommandConstraints()
IdeCommandConstraints() constructor creates an "empty" constraint object which
public IdeCommandConstraints(String values)
String of comma-delimited constraints| Association Links |
"location".to Class java.lang.String
"mainMenu".to Class java.lang.String
"mainToolbar".to Class java.lang.String
"popupMenu".to Class java.lang.String
"placeBefore".to Class java.lang.String
"placeAfter".to Class java.lang.String
"parent".to Class java.lang.String
"context".to Class java.lang.String
"element".to Class java.lang.String
"file".to Class java.lang.String
"textEditor".to Class java.lang.String
"shapeType".to Class java.lang.String
"extension".to Class java.lang.String
"fileCategory".
| ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||