use of com.liferay.ide.layouttpl.core.model.LayoutTplElement in project liferay-ide by liferay.
the class AddLayoutTemplateActionHandlerFactory method init.
@Override
public void init(SapphireAction action, ActionHandlerFactoryDef def) {
super.init(action, def);
LayoutTplElement tplElement = getModelElement().nearest(LayoutTplElement.class);
Value<Boolean> bootstrapStyle = tplElement.getBootstrapStyle();
_bootstrapStyle = bootstrapStyle.content();
}
use of com.liferay.ide.layouttpl.core.model.LayoutTplElement in project liferay-ide by liferay.
the class LayoutTplEditor method createEmptyDiagramModel.
protected LayoutTplElement createEmptyDiagramModel() {
LayoutTplElement layoutTpl = LayoutTplElement.TYPE.instantiate();
layoutTpl.setBootstrapStyle(_isBootstrapStyle());
String editorInputName = getEditorInput().getName();
layoutTpl.setClassName(editorInputName.replaceAll("\\..*$", ""));
layoutTpl.setIs62(_is62());
return layoutTpl;
}
use of com.liferay.ide.layouttpl.core.model.LayoutTplElement in project liferay-ide by liferay.
the class LayoutTplEditor method refreshDiagramModel.
protected void refreshDiagramModel() {
LayoutTplElement newElement = LayoutTplElementsFactory.INSTANCE.newLayoutTplFromFile(getFile(), _bootstrapStyle, _is62);
if (newElement == null) {
/*
* create an empty model for diagram in memory, but not write to
* source
*/
newElement = createEmptyDiagramModel();
}
Element model = getModelElement();
model.clear();
model.copy(newElement);
}
use of com.liferay.ide.layouttpl.core.model.LayoutTplElement 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 com.liferay.ide.layouttpl.core.model.LayoutTplElement in project liferay-ide by liferay.
the class LayoutTemplatesFactory method _isBootstrapStyle.
private static boolean _isBootstrapStyle(CanAddPortletLayouts element) {
LayoutTplElement layoutTplElement = element.nearest(LayoutTplElement.class);
Value<Boolean> bootstrapStyle = layoutTplElement.getBootstrapStyle();
return bootstrapStyle.content();
}
Aggregations