Search in sources :

Example 6 with IDataModelListener

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);
}
Also used : Group(org.eclipse.swt.widgets.Group) IDataModelListener(org.eclipse.wst.common.frameworks.datamodel.IDataModelListener) GridData(org.eclipse.swt.layout.GridData) DataModelEvent(org.eclipse.wst.common.frameworks.datamodel.DataModelEvent)

Example 7 with IDataModelListener

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();
            }
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) IDataModelListener(org.eclipse.wst.common.frameworks.datamodel.IDataModelListener) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) DataModelEvent(org.eclipse.wst.common.frameworks.datamodel.DataModelEvent) Text(org.eclipse.swt.widgets.Text) Font(org.eclipse.swt.graphics.Font)

Aggregations

DataModelEvent (org.eclipse.wst.common.frameworks.datamodel.DataModelEvent)7 IDataModelListener (org.eclipse.wst.common.frameworks.datamodel.IDataModelListener)7 GridData (org.eclipse.swt.layout.GridData)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 Button (org.eclipse.swt.widgets.Button)2 Composite (org.eclipse.swt.widgets.Composite)2 Group (org.eclipse.swt.widgets.Group)2 IProject (org.eclipse.core.resources.IProject)1 Font (org.eclipse.swt.graphics.Font)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1 DataModelPropertyDescriptor (org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor)1 IFacetedProjectEvent (org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent)1 IFacetedProjectListener (org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener)1 IRuntime (org.eclipse.wst.common.project.facet.core.runtime.IRuntime)1