Search in sources :

Example 6 with DataModelEvent

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

Example 7 with DataModelEvent

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);
}
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 8 with DataModelEvent

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();
            }
        }
    });
}
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)8 IDataModelListener (org.eclipse.wst.common.frameworks.datamodel.IDataModelListener)7 GridData (org.eclipse.swt.layout.GridData)4 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Button (org.eclipse.swt.widgets.Button)3 Font (org.eclipse.swt.graphics.Font)2 Composite (org.eclipse.swt.widgets.Composite)2 Group (org.eclipse.swt.widgets.Group)2 Label (org.eclipse.swt.widgets.Label)2 Text (org.eclipse.swt.widgets.Text)2 IProject (org.eclipse.core.resources.IProject)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 DataModelPropertyDescriptor (org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor)1 IDataModel (org.eclipse.wst.common.frameworks.datamodel.IDataModel)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