|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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
CancelableEvaluationVisitor refines the EvaluationVisitor to poll the monitor foer cancelation at a variety of significant evaluation events, such as feature vists and OCLConsolePage.CancelableEvaluationVisitor.getValueFactory(). |
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. |
MetaModelManager |
getMetaModelManager(org.eclipse.emf.ecore.EObject contextObject)
|
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.IPagecreateControl in class org.eclipse.ui.part.Pagepublic void dispose()
dispose in interface org.eclipse.ui.part.IPagedispose in class org.eclipse.ui.part.Pageprotected org.eclipse.jface.viewers.ISelection getActiveSelection()
public org.eclipse.swt.widgets.Control getControl()
getControl in interface org.eclipse.ui.part.IPagegetControl in class org.eclipse.ui.part.Pagepublic 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
public MetaModelManager getMetaModelManager(org.eclipse.emf.ecore.EObject contextObject)
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.IPagesetFocus in class org.eclipse.ui.part.Page
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||