use of org.eclipse.wst.common.frameworks.datamodel.IDataModelListener 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.IDataModelListener 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