use of org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter in project tdi-studio-se by Talend.
the class GearBusinessItemNameEditPart method getEditTextValidator.
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
public String isValid(final Object value) {
if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
public void run() {
setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
// ie.printStackTrace();
ExceptionHandler.process(ie);
}
}
// shouldn't get here
return null;
}
};
}
use of org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter in project tdi-studio-se by Talend.
the class DirectionalBusinessItemRelationshipNameEditPart method getEditTextValidator.
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
public String isValid(final Object value) {
if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
public void run() {
setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException e) {
// ie.printStackTrace();
ExceptionHandler.process(e);
}
}
// shouldn't get here
return null;
}
};
}
use of org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter in project tdi-studio-se by Talend.
the class InputBusinessItemNameEditPart method getEditTextValidator.
/**
* @generated
*/
public ICellEditorValidator getEditTextValidator() {
return new ICellEditorValidator() {
public String isValid(final Object value) {
if (value instanceof String) {
final EObject element = getParserElement();
final IParser parser = getParser();
try {
IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {
public void run() {
setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
}
});
return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
} catch (InterruptedException ie) {
// ie.printStackTrace();
ExceptionHandler.process(ie);
}
}
// shouldn't get here
return null;
}
};
}
use of org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter in project statecharts by Yakindu.
the class StateTextCompartmentViewFactory method decorateView.
@Override
protected void decorateView(View containerView, View view, IAdaptable semanticAdapter, String semanticHint, int index, boolean persisted) {
super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
IAdaptable eObjectAdapter = null;
EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
if (eObject != null) {
eObjectAdapter = new EObjectAdapter(eObject);
}
getViewService().createNode(eObjectAdapter, view, SemanticHints.STATE_TEXT_COMPARTMENT_EXPRESSION, ViewUtil.APPEND, true, getPreferencesHint());
}
use of org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter in project statecharts by Yakindu.
the class CompartmentLayoutEditPolicy method createAddCommand.
@Override
protected Command createAddCommand(EditPart child, EditPart after) {
int index = getHost().getChildren().indexOf(after);
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
AddCommand command = new CompartmentAddCommand(editingDomain, new EObjectAdapter((View) getHost().getModel()), new EObjectAdapter((View) child.getModel()), index);
return new ICommandProxy(command);
}
Aggregations