use of org.eclipse.sapphire.ImageData in project liferay-ide by liferay.
the class WindowStateImageService method compute.
@Override
protected ImageData compute() {
String strWindowState = null;
Element element = context(Element.class);
ImageData imageData = null;
if (element instanceof CustomWindowState) {
CustomWindowState customWindowState = (CustomWindowState) element;
strWindowState = String.valueOf(customWindowState.getWindowState().content());
} else if (element instanceof WindowState) {
WindowState windowState = (WindowState) element;
strWindowState = windowState.getWindowState().content();
}
if ("MAXIMIZED".equalsIgnoreCase(strWindowState)) {
imageData = IMG_MAXIMIZED;
} else if ("MINIMIZED".equalsIgnoreCase(strWindowState)) {
imageData = IMG_MINIMIZED;
}
if (imageData == null) {
imageData = IMG_DEFAULT;
}
return imageData;
}
use of org.eclipse.sapphire.ImageData in project liferay-ide by liferay.
the class DefaultListAddActionHandler method init.
@Override
public void init(SapphireAction action, ActionHandlerDef def) {
super.init(action, def);
ImageData typeSpecificAddImage = _type.image();
if (typeSpecificAddImage != null) {
addImage(typeSpecificAddImage);
}
setLabel(_type.getLabel(false, CapitalizationType.TITLE_STYLE, false));
}
use of org.eclipse.sapphire.ImageData in project liferay-ide by liferay.
the class ListSelectionEditHandler method init.
@Override
public void init(SapphireAction action, ActionHandlerDef def) {
super.init(action, def);
ImageData typeImage = typeImage();
if (typeImage != null) {
addImage(typeImage);
}
ListSelectionService selectionService = action.getPart().service(ListSelectionService.class);
Listener selectionListener = new Listener() {
@Override
public void handle(Event event) {
refreshEnablementState();
}
};
if (selectionService != null) {
selectionService.attach(selectionListener);
}
}
use of org.eclipse.sapphire.ImageData in project liferay-ide by liferay.
the class ColumnImageService method compute.
@Override
public ImageData compute() {
ImageData imageData = null;
Column column = context(Column.class);
if (column.isPrimary().content()) {
imageData = _IMG_COLUMN_PRIMARY;
} else {
imageData = _IMG_COLUMN;
}
return imageData;
}
use of org.eclipse.sapphire.ImageData in project liferay-ide by liferay.
the class PortletModeImageService method compute.
@Override
protected ImageData compute() {
String portletMode = null;
Element element = context(Element.class);
ImageData imageData = null;
if (element instanceof CustomPortletMode) {
CustomPortletMode iCustomPortletMode = (CustomPortletMode) element;
portletMode = String.valueOf(iCustomPortletMode.getPortletMode().content());
} else if (element instanceof PortletMode) {
PortletMode iPortletMode = (PortletMode) element;
portletMode = iPortletMode.getPortletMode().content();
}
if (portletMode != null) {
if ("VIEW".equalsIgnoreCase(portletMode)) {
imageData = IMG_VIEW;
} else if ("EDIT".equalsIgnoreCase(portletMode)) {
imageData = IMG_EDIT;
} else if ("HELP".equalsIgnoreCase(portletMode)) {
imageData = IMG_HELP;
}
}
if (imageData == null) {
imageData = IMG_DEFAULT;
}
return imageData;
}
Aggregations