|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.ui.part.Page org.eclipse.ocl.examples.xtext.console.OCLConsolePage
public class OCLConsolePage
The page implementing the Interactive OCL console.
Nested Class Summary | |
---|---|
protected static class |
OCLConsolePage.CancelableEvaluationVisitor
|
protected static class |
OCLConsolePage.CancelableTypeManager
|
protected static class |
OCLConsolePage.ExceptionValue
|
Method Summary | |
---|---|
void |
createControl(org.eclipse.swt.widgets.Composite parent)
|
void |
dispose()
Extends the inherited method to dispose of additional colour resources. |
protected org.eclipse.jface.viewers.ISelection |
getActiveSelection()
|
org.eclipse.swt.widgets.Control |
getControl()
|
org.eclipse.xtext.ui.editor.model.IXtextDocument |
getDocument(org.eclipse.emf.common.util.URI trimFragment)
|
BaseDocument |
getEditorDocument()
|
java.lang.String |
getLastOCLExpression()
Gets the editor image for the specified element. |
protected void |
refreshSelection(java.lang.Object selected)
Prints the specified object to the output viewer. |
void |
setFocus()
|
Methods inherited from class org.eclipse.ui.part.Page |
---|
getSite, init, makeContributions, setActionBars |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void createControl(org.eclipse.swt.widgets.Composite parent)
createControl
in interface org.eclipse.ui.part.IPage
createControl
in class org.eclipse.ui.part.Page
public void dispose()
dispose
in interface org.eclipse.ui.part.IPage
dispose
in class org.eclipse.ui.part.Page
protected org.eclipse.jface.viewers.ISelection getActiveSelection()
public org.eclipse.swt.widgets.Control getControl()
getControl
in interface org.eclipse.ui.part.IPage
getControl
in class org.eclipse.ui.part.Page
public org.eclipse.xtext.ui.editor.model.IXtextDocument getDocument(org.eclipse.emf.common.util.URI trimFragment)
public BaseDocument getEditorDocument()
public java.lang.String getLastOCLExpression()
element
- a model element
protected void refreshSelection(java.lang.Object selected)
object
to the output viewer. The
object is converted to a string using the best matching EMF label
provider adapter if it is an EObject
; otherwise, just use
String.valueOf(java.lang.Object)
on it. If the
object
is a collection or an array, then we print each
element on a separate line.
object
- the object or collection to printcolor
- the color to print the object
withbold
- whether to display it in bold text
private void print(Value value, Color color, boolean bold) {
CollectionValue collectionValue = value.isCollectionValue();
if (collectionValue != null) {
for (Value elementValue : collectionValue) {
append(String.valueOf(elementValue), color, bold);
}
}
else {
append(String.valueOf(value), color, bold);
}
/* Collection> toPrint;
if (object == null) {
toPrint = Collections.EMPTY_SET;
} else if (object instanceof Collection) {
toPrint = (Collection>) object;
} else if (object.getClass().isArray()) {
toPrint = Arrays.asList((Object[]) object);
} else {
toPrint = Collections.singleton(object);
}
for (Iterator> iter = toPrint.iterator(); iter.hasNext();) {
append(toString(iter.next()), color, bold);
} * /
// append(String.valueOf(object), color, bold);
scrollText();
}public void setFocus()
setFocus
in interface org.eclipse.ui.part.IPage
setFocus
in class org.eclipse.ui.part.Page
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |