use of com.liferay.ide.portlet.core.model.CustomWindowState 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 com.liferay.ide.portlet.core.model.CustomWindowState in project liferay-ide by liferay.
the class WindowStatesPossibleValueService method refreshValues.
private void refreshValues() {
PortletApp portletApp = context(PortletApp.class);
if ((portletApp != null) && !portletApp.disposed()) {
Set<String> newValues = new TreeSet<>();
for (int i = 0; i < DEFAULT_STATES.length; i++) {
newValues.add(DEFAULT_STATES[i]);
}
List<CustomWindowState> customWindowStates = portletApp.getCustomWindowStates();
for (CustomWindowState iCustomWindowState : customWindowStates) {
String customWindowState = iCustomWindowState.getWindowState().text(false);
if (customWindowState != null) {
newValues.add(customWindowState);
}
}
if (!this.values.equals(newValues)) {
this.values = Collections.unmodifiableSet(newValues);
}
if (this.initialized || this.readPriorToInit) {
refresh();
}
}
}
Aggregations