use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.
the class CreateDirectoryActionHandler method init.
@Override
public void init(SapphireAction action, ActionHandlerDef def) {
super.init(action, def);
Element element = getModelElement();
ValueProperty property = (ValueProperty) property().definition();
Listener listener = new FilteredListener<PropertyEvent>() {
@Override
public void handleTypedEvent(PropertyEvent event) {
refreshEnablementState();
}
};
element.attach(listener, property.name());
attach(new Listener() {
@Override
public void handle(Event event) {
if (event instanceof DisposeEvent) {
element.detach(listener, property.name());
}
}
});
}
use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.
the class CustomJspsEnablementService method initEnablementService.
@Override
protected void initEnablementService() {
Listener listener = new FilteredListener<PropertyEvent>() {
protected void handleTypedEvent(PropertyEvent event) {
refresh();
}
};
ElementHandle<Element> element = _hook().property(Hook.PROP_CUSTOM_JSP_DIR);
element.attach(listener, CustomJspDir.PROP_VALUE.name());
}
use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.
the class LayoutTplEditor method createModel.
@Override
protected Element createModel() {
IFile file = getFile();
_bootstrapStyle = _isBootstrapStyle();
_is62 = _is62();
LayoutTplElement layoutTpl = LayoutTplElementsFactory.INSTANCE.newLayoutTplFromFile(file, _bootstrapStyle, _is62);
if (layoutTpl == null) {
layoutTpl = createEmptyDiagramModel();
}
Listener listener = new Listener() {
@Override
public void handle(Event event) {
setDesignPageChanged(true);
firePropertyChange(PROP_DIRTY);
}
};
layoutTpl.attach(listener, "*");
return layoutTpl;
}
use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.
the class TaskScriptedAssignmentCondition method initCondition.
@Override
protected void initCondition(ISapphirePart part, String parameter) {
super.initCondition(part, parameter);
Task task = _task();
Listener assignmentTypeListener = new FilteredListener<PropertyContentEvent>() {
@Override
public void handleTypedEvent(PropertyContentEvent event) {
updateConditionState();
}
};
if (task != null) {
task.attach(assignmentTypeListener, Task.PROP_SCRIPTED_ASSIGNMENT.name());
}
updateConditionState();
}
use of org.eclipse.sapphire.Listener in project liferay-ide by liferay.
the class WorkflowDefinitionLayoutPersistenceService method _addDiagramPartListener.
private void _addDiagramPartListener() {
_diagramPartListener = new Listener() {
@Override
public void handle(Event event) {
if (event instanceof DiagramNodeEvent) {
DiagramNodeEvent nodeEvent = (DiagramNodeEvent) event;
_handleDiagramNodeEvent(nodeEvent);
} else if (event instanceof DiagramPageEvent) {
DiagramPageEvent pageEvent = (DiagramPageEvent) event;
_handleDiagramPageEvent(pageEvent);
} else if (event instanceof PreAutoLayoutEvent) {
_autoLayout = true;
} else if (event instanceof PostAutoLayoutEvent) {
_autoLayout = false;
} else if (event instanceof ConnectionAddEvent) {
ConnectionAddEvent addEvent = (ConnectionAddEvent) event;
handleConnectionAddEvent(addEvent);
} else if (event instanceof ConnectionDeleteEvent) {
handleConnectionDeleteEvent((ConnectionDeleteEvent) event);
}
}
};
_part().attach(_diagramPartListener);
}
Aggregations