use of org.eclipse.wst.common.frameworks.datamodel.DataModelEvent in project liferay-ide by liferay.
the class NewLiferayPortletWizardPage method createLiferayPortletInfoGroup.
protected void createLiferayPortletInfoGroup(Composite composite) {
SelectionAdapter adapter;
Group group = SWTUtil.createGroup(composite, Msgs.liferayPortletInfo, 3);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
group.setLayoutData(gd);
// we don't need to create the name as it can never be anything different than
// the portlet name on 2nd page
// SWTUtil.createLabel(group, SWT.RIGHT, "Name:", 1);
//
// this.name = SWTUtil.createText(group, 1);
// this.synchHelper.synchText(name, LIFERAY_PORTLET_NAME, null);
// SWTUtil.createLabel(group, StringUtil.EMPTY, 1);
SWTUtil.createLabel(group, SWT.RIGHT, Msgs.iconLabel, 1);
iconFile = SWTUtil.createText(group, 1);
this.synchHelper.synchText(iconFile, ICON_FILE, null);
if (fragment) {
SWTUtil.createLabel(group, StringPool.EMPTY, 1);
} else {
Button iconFileBrowse = SWTUtil.createPushButton(group, Msgs.browse, null);
adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleFileBrowseButton(NewLiferayPortletWizardPage.this.iconFile, Msgs.iconSelection, Msgs.chooseIconFileLabel);
}
};
iconFileBrowse.addSelectionListener(adapter);
}
SWTUtil.createLabel(group, StringPool.EMPTY, 1);
allowMultiInstanceButton = SWTUtil.createCheckButton(group, Msgs.allowMultipleInstances, null, true, 2);
this.synchHelper.synchCheckbox(allowMultiInstanceButton, ALLOW_MULTIPLE, null);
SWTUtil.createLabel(group, SWT.RIGHT, Msgs.cssLabel, 1);
cssFile = SWTUtil.createText(group, 1);
this.synchHelper.synchText(cssFile, CSS_FILE, null);
if (fragment) {
SWTUtil.createLabel(group, StringPool.EMPTY, 1);
} else {
Button cssFileBrowse = SWTUtil.createPushButton(group, Msgs.browse, null);
SelectionAdapter selectionAdapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleFileBrowseButton(NewLiferayPortletWizardPage.this.cssFile, Msgs.cssSelection, Msgs.chooseCssFileLabel);
}
};
cssFileBrowse.addSelectionListener(selectionAdapter);
}
SWTUtil.createLabel(group, SWT.RIGHT, Msgs.javascriptLabel, 1);
javascriptFile = SWTUtil.createText(group, 1);
this.synchHelper.synchText(javascriptFile, JAVASCRIPT_FILE, null);
if (fragment) {
SWTUtil.createLabel(group, StringPool.EMPTY, 1);
} else {
Button javascriptFileBrowse = SWTUtil.createPushButton(group, Msgs.browse, null);
adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleFileBrowseButton(NewLiferayPortletWizardPage.this.javascriptFile, Msgs.javascriptSelection, Msgs.chooseJavascriptFileLabel);
}
};
javascriptFileBrowse.addSelectionListener(adapter);
}
SWTUtil.createLabel(group, SWT.RIGHT, Msgs.cssClassWrapperLabel, 1);
cssClassWrapper = SWTUtil.createText(group, 1);
this.synchHelper.synchText(cssClassWrapper, CSS_CLASS_WRAPPER, null);
SWTUtil.createLabel(group, StringPool.EMPTY, 1);
IDataModelListener listener = new IDataModelListener() {
public void propertyChanged(DataModelEvent event) {
if (INewJavaClassDataModelProperties.CLASS_NAME.equals(event.getPropertyName()) || PORTLET_NAME.equals(event.getPropertyName())) {
synchHelper.synchAllUIWithModel();
}
}
};
this.synchHelper.getDataModel().addListener(listener);
}
use of org.eclipse.wst.common.frameworks.datamodel.DataModelEvent in project liferay-ide by liferay.
the class NewPortletOptionsWizardPage method createPortletInfoGroup.
protected void createPortletInfoGroup(Composite composite) {
Group group = SWTUtil.createGroup(composite, Msgs.portletInfo, 2);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
group.setLayoutData(gd);
SWTUtil.createLabel(group, Msgs.nameLabel, 1);
portletName = SWTUtil.createText(group, 1);
this.synchHelper.synchText(portletName, PORTLET_NAME, null);
SWTUtil.createLabel(group, Msgs.displayNameLabel, 1);
displayName = SWTUtil.createText(group, 1);
this.synchHelper.synchText(displayName, DISPLAY_NAME, null);
SWTUtil.createLabel(group, Msgs.titleLabel, 1);
title = SWTUtil.createText(group, 1);
this.synchHelper.synchText(title, TITLE, null);
IDataModelListener listener = new IDataModelListener() {
public void propertyChanged(DataModelEvent event) {
if (CLASS_NAME.equals(event.getPropertyName()) || PORTLET_NAME.equals(event.getPropertyName())) {
synchHelper.synchAllUIWithModel();
}
}
};
this.synchHelper.getDataModel().addListener(listener);
}
use of org.eclipse.wst.common.frameworks.datamodel.DataModelEvent in project liferay-ide by liferay.
the class NewPluginProjectGroup method createDisplayNameGroup.
protected void createDisplayNameGroup(Composite parent) {
// project specification group
Font font = parent.getFont();
Composite displayGroup = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
displayGroup.setLayout(layout);
displayGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// new project label
Label displayLabel = new Label(displayGroup, SWT.NONE);
displayLabel.setFont(font);
displayLabel.setText(Msgs.displayNameLabel);
// new project name entry field
displayNameField = new Text(displayGroup, SWT.BORDER);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
data.widthHint = SIZING_TEXT_FIELD_WIDTH;
displayNameField.setLayoutData(data);
displayNameField.setFont(font);
synchHelper.synchText(displayNameField, DISPLAY_NAME, new Control[] { displayLabel });
nestedSynchHelper.getDataModel().addListener(new IDataModelListener() {
public void propertyChanged(DataModelEvent event) {
if (PROJECT_NAME.equals(event.getPropertyName())) {
synchHelper.synchAllUIWithModel();
}
}
});
}
Aggregations