use of org.eclipse.sapphire.PropertyEvent in project liferay-ide by liferay.
the class CreatePortletAppResourceBundleActionHandler method init.
/**
* (non-Javadoc)
*
* @see
* org.eclipse.sapphire.ui.SapphirePropertyEditorActionHandler#init(org.eclipse.
* sapphire.ui.SapphireAction, ActionHandlerDef)
*/
@Override
public void init(SapphireAction action, ActionHandlerDef def) {
super.init(action, def);
Element element = getModelElement();
Property property = property();
listener = new FilteredListener<PropertyEvent>() {
@Override
protected void handleTypedEvent(PropertyEvent event) {
refreshEnablementState();
}
};
element.attach(listener, property.definition().name());
Listener listen = new Listener() {
@Override
public void handle(Event event) {
if (event instanceof DisposeEvent) {
PropertyDef definition = property().definition();
getModelElement().detach(listener, definition.name());
}
}
};
attach(listen);
}
use of org.eclipse.sapphire.PropertyEvent in project liferay-ide by liferay.
the class CreatePortletResourceBundleActionHandler method init.
/**
* (non-Javadoc)
*
* @see
* org.eclipse.sapphire.ui.SapphirePropertyEditorActionHandler#init(org.eclipse.
* sapphire.ui.SapphireAction, ActionHandlerDef)
*/
@Override
public void init(SapphireAction action, ActionHandlerDef def) {
super.init(action, def);
Element element = getModelElement();
listener = new FilteredListener<PropertyEvent>() {
@Override
protected void handleTypedEvent(PropertyEvent event) {
refreshEnablementState();
}
};
element.attach(listener, property().name());
element.attach(listener, Portlet.PROP_SUPPORTED_LOCALES.name());
element.attach(listener, Portlet.PROP_SUPPORTED_LOCALES.name() + "/" + SupportedLocales.PROP_SUPPORTED_LOCALE.name());
Listener listen = new Listener() {
public void handle(Event event) {
if (event instanceof DisposeEvent) {
getModelElement().detach(listener, property().name());
getModelElement().detach(listener, Portlet.PROP_SUPPORTED_LOCALES.name());
getModelElement().detach(listener, Portlet.PROP_SUPPORTED_LOCALES.name() + "/" + SupportedLocales.PROP_SUPPORTED_LOCALE.name());
}
}
};
attach(listen);
}
Aggregations