use of org.yakindu.sct.ui.editor.editparts.StateEditPart in project statecharts by Yakindu.
the class ToggleSubRegionLayoutCommand method unwrap.
protected View unwrap(ISelection selection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
Object firstElement = structuredSelection.getFirstElement();
if (firstElement == null)
return null;
return ((StateEditPart) firstElement).getNotationView();
}
use of org.yakindu.sct.ui.editor.editparts.StateEditPart in project statecharts by Yakindu.
the class StateCompartmentCreationEditPolicy method getCreateCommand.
@Override
protected Command getCreateCommand(CreateViewRequest request) {
StateEditPart parent = (StateEditPart) getHost().getParent();
BooleanValueStyle isInline = GMFNotationUtil.getBooleanValueStyle(parent.getNotationView(), DiagramPartitioningUtil.INLINE_STYLE);
if (isInline != null && !isInline.isBooleanValue())
return UnexecutableCommand.INSTANCE;
List<? extends ViewDescriptor> viewDescriptors = request.getViewDescriptors();
for (ViewDescriptor viewDescriptor : viewDescriptors) {
String semanticHint = viewDescriptor.getSemanticHint();
if (ViewType.NOTE.equals(semanticHint) || ViewType.NOTEATTACHMENT.equals(semanticHint) || ViewType.TEXT.equals(semanticHint)) {
return UnexecutableCommand.INSTANCE;
}
}
return super.getCreateCommand(request);
}
use of org.yakindu.sct.ui.editor.editparts.StateEditPart in project statecharts by Yakindu.
the class StateCompartmentCanonicalEditPolicy method getSemanticChildrenList.
@SuppressWarnings("rawtypes")
@Override
protected List getSemanticChildrenList() {
StateEditPart parent = (StateEditPart) getHost().getParent();
BooleanValueStyle isInline = GMFNotationUtil.getBooleanValueStyle(parent.getNotationView(), INLINE_STYLE);
if (isInline == null || isInline.isBooleanValue())
return getSemanticHost().getRegions();
return Collections.EMPTY_LIST;
}
use of org.yakindu.sct.ui.editor.editparts.StateEditPart in project statecharts by Yakindu.
the class AbstractStateRefactoringHandler method setContext.
@Override
public void setContext(AbstractRefactoring<State> refactoring, ISelection selection) {
StateEditPart element = (StateEditPart) getFirstElement(selection);
if (element == null) {
refactoring.setContextObjects(Collections.<State>emptyList());
} else {
State state = element.resolveSemanticElement();
refactoring.setContextObjects(Lists.newArrayList(state));
}
}
Aggregations