Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Label


    protected Control createDialogArea(Composite parent) {
        Composite composite = new Composite(parent, SWT.None);
        composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
        GridLayout layout = new GridLayout(2, false);
        composite.setLayout(layout);
        new Label(composite, SWT.NONE).setText("Add properties to content type");
        new Label(composite, SWT.NONE);
       
        for (WGMetaFieldDefinition def : METADATA_DEFINITIONS.values()) {
            Button checkMetaData = new Button(composite, SWT.CHECK);
            checkMetaData.setText(METADATA_DEFINITION_LABELS.get(def.getName()));
            if (hasMetaDataDefinition(_contentTypeDefinition, def)) {
View Full Code Here


  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    container.setLayout(layout);
    new Label(container, SWT.NONE).setText("Module name for the outerlayout:");
    _txtOuterLayoutName = new Text(container, SWT.BORDER);
    _txtOuterLayoutName.setText(DEFAULT_OUTERLAYOUT_NAME);
    _txtOuterLayoutName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    _txtOuterLayoutName.addModifyListener(this);

    new Label(container, SWT.NONE).setText("Module name for the innerlayout:");
    _txtInnerLayoutName = new Text(container, SWT.BORDER);
    _txtInnerLayoutName.setText(DEFAULT_INNERLAYOUT_NAME);
    _txtInnerLayoutName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    _txtInnerLayoutName.addModifyListener(this);
   
View Full Code Here

    data.horizontalSpan = 2;

    GridData txtStyle = new GridData(GridData.FILL_HORIZONTAL);
    txtStyle.minimumWidth = convertWidthInCharsToPixels(50);

    Label fileslbl = new Label(composite, SWT.None);
    fileslbl.setText("Labelfile:");
    _comboFiles = new Combo(composite, SWT.BORDER);
    _comboFiles.setItems(refreshLabelFilesInFolder());
    _comboFiles.setLayoutData(GridDataFactory.copyData(txtStyle));

    String searchFor = "general";
    int i = 0;
    boolean found = false;

    if (Plugin.getDefault().getPreferenceStore().getString((Preferences.LAST_SELECTED_LABELFILE)) != null
        && !Plugin.getDefault().getPreferenceStore().getString(Preferences.LAST_SELECTED_LABELFILE).equals("")) {
      searchFor = Plugin.getDefault().getPreferenceStore().getString((Preferences.LAST_SELECTED_LABELFILE));

      for (String item : _comboFiles.getItems()) {
        if (item.equals(searchFor)) {
          found = true;
          break;
        }

      }

      if (!found) {
        searchFor = "general";
      }
    }

    i = 0;
    for (String item : _comboFiles.getItems()) {
      if (item.equals(searchFor)) {
        break;
      }
      i++;
    }

    _comboFiles.select(i);

    Group group = new Group(composite, SWT.SHADOW_OUT);
    group.setLayoutData(data);
    group.setLayout(layout);

    group.setText("Prefix");

    // new Label(group,SWT.NONE)
    _buttonCheckPrefix = new Button(group, SWT.CHECK);
    _buttonCheckPrefix.setText("use Prefix");
    _buttonCheckPrefix.setLayoutData(data);
   

    Label labelPrefix = new Label(group, SWT.NONE);
    labelPrefix.setText("Prefix :");

    _comboPrefix = new Combo(group, SWT.BORDER | SWT.READ_ONLY);   
    _comboPrefix.setLayoutData(GridDataFactory.copyData(txtStyle));

    _comboPrefix.setEnabled(false);

    // textfield key

    Label keylbl = new Label(composite, SWT.None);
    keylbl.setText("Labelkey:");
    _txtKeyTabNew = new Text(composite, SWT.BORDER);

    _txtKeyTabNew.setLayoutData(GridDataFactory.copyData(txtStyle));   
    _txtKeyTabNew.setFocus();
View Full Code Here

        subform.setLayout(subformLayout);              
        Text txtName = factory.createText(subform, "Name:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        factory.createCheckBox(subform, "Auto creation:", "Enabled", "autoCreate");

        Label lblActions = new Label(subform, SWT.NONE);
        lblActions.setText("Actions:");
        HyperlinkGroup actionGroup = new HyperlinkGroup(Display.getCurrent());
        Hyperlink defineMetas = new Hyperlink(subform, SWT.NONE);
        defineMetas.setText("add properties...");
        defineMetas.addHyperlinkListener(new IHyperlinkListener() {           
            public void linkExited(HyperlinkEvent e) {
            }
           
            public void linkEntered(HyperlinkEvent e) {              
            }
           
            public void linkActivated(HyperlinkEvent e) {
                handleAddMetaDataDefinition();               
            }
        });
        actionGroup.add(defineMetas);
       
        Label lbl = new Label(subform, SWT.NONE);
        Hyperlink defineItems = new Hyperlink(subform, SWT.NONE);
        defineItems.setText("add item definition...");
        defineItems.addHyperlinkListener(new IHyperlinkListener() {
           
            public void linkExited(HyperlinkEvent e) {
            }
           
            public void linkEntered(HyperlinkEvent e) {
            }
           
            public void linkActivated(HyperlinkEvent e) {
                handleAddItemDefinition();               
            }
        });
        actionGroup.add(defineItems);
       
        WGContentTypeDefinitionModel contentTypeDefinitionModel = new WGContentTypeDefinitionModel();
        contentTypeDefinitionModel.addListener(new BeanChangedListener<WGContentTypeDefinition>() {
            public void changed(WGContentTypeDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }
        });               
        _subforms.put(SUBFORM_CONTENT_TYPE_DEFINITION, subform);
        _subformModels.put(SUBFORM_CONTENT_TYPE_DEFINITION, contentTypeDefinitionModel);
       
        // area subform
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);             
        txtName = factory.createText(subform, "Name:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        factory.createCheckBox(subform, "Auto creation:", "Enabled", "autoCreate");

        WGAreaDefinitionModel areaDefintionModel = new WGAreaDefinitionModel();
        areaDefintionModel.addListener(new BeanChangedListener<WGAreaDefinition>() {
            public void changed(WGAreaDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }           
        });
        _subforms.put(SUBFORM_AREA_DEFINITION, subform);
        _subformModels.put(SUBFORM_AREA_DEFINITION, areaDefintionModel);
       
        // language subform
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);             
        txtName = factory.createText(subform, "Name:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        factory.createCheckBox(subform, "Auto creation:", "Enabled", "autoCreate");
       
        WGLanguageDefinitionModel languageDefinitionModel = new WGLanguageDefinitionModel();
        languageDefinitionModel.addListener(new BeanChangedListener<WGLanguageDefinition>() {
            public void changed(WGLanguageDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }           
        });
        _subforms.put(SUBFORM_LANGUAGE_DEFINITION, subform);
        _subformModels.put(SUBFORM_LANGUAGE_DEFINITION, languageDefinitionModel);

        // item subform
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);
       
        Group parentGroup = createParentInformationGroup(subform);
        GridData parentInfoLayoutData = new GridData(GridData.FILL_HORIZONTAL);       
        parentInfoLayoutData.horizontalSpan = 2;
        parentGroup.setLayoutData(parentInfoLayoutData);
       
        txtName = factory.createText(subform, "Itemname:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        Combo itemTypeCombo = factory.createCombo(subform, "Type:", "type");       
        _chkItemList = factory.createCheckBox(subform, "List:", "Enabled", "list");

        _lblInitialValues = new Label(subform, SWT.NONE);
        _lblInitialValues.setText("Initial values:");
        _lblInitialValues.setLayoutData(new GridData(SWT.NONE, SWT.BEGINNING, false, false));
       
        _initialValuesSection = toolkit.createSection(subform, Section.EXPANDED | Section.NO_TITLE);
       
        GridData initialValuesSectionLayoutData = new GridData(GridData.FILL_BOTH);
        _initialValuesSection.setLayoutData(initialValuesSectionLayoutData);

        // item subform - text values
        _initialTextValuesSectionClient = toolkit.createComposite(_initialValuesSection);
        _initialTextValuesSectionClient.setLayout(new FillLayout());
        _tblItemTextValues = new EditableTableControl<PrimitiveTypeBean<String>>(_initialTextValuesSectionClient, SWT.NONE);
        _itemTextValuesModel = new PrimitiveTypeBeanListTableModel<String>(true);
        _itemTextValuesModel.addListener(new BeanListTableModelListener() {
           
            public void update(Object bean) {
                _model.fireModelChanged();               
            }
           
            public void remove(Object bean) {
                _model.fireModelChanged();
            }
           
            public void refresh(List beans) {
            }
           
            public void add(Object bean) {
                _model.fireModelChanged();               
            }
        });
        _tblItemTextValues.init(new String[] {"#", "Value"}, _itemTextValuesModel);
        CellEditor[] cellEditors = new CellEditor[2];
        cellEditors[0] = null;
        cellEditors[1] = new TextCellEditor(_tblItemTextValues.getTable());
        _tblItemTextValues.getTableViewer().setCellEditors(cellEditors);
       
        _tblItemTextValues.getButton(EditableTableControl.BUTTON_ADD).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                WGContentItemDefinitionModel model = (WGContentItemDefinitionModel)_subformModels.get(SUBFORM_CONTENT_ITEM_DEFINITION);
                if (_itemTextValuesModel.getBeans().size() > 0) {                   
                    _chkItemList.setSelection(true);
                    model.setList(true);
                }
                handleAdd(_tblItemTextValues, "");
            }
        });

        _tblItemTextValues.getButton(EditableTableControl.BUTTON_REMOVE).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleRemove(_tblItemTextValues);
            }
        });
       
       
        // item subform - boolean values
        _initialBooleanValuesSectionClient = toolkit.createComposite(_initialValuesSection);
        _initialBooleanValuesSectionClient.setLayout(new FillLayout());
        _tblItemBooleanValues = new EditableTableControl<PrimitiveTypeBean<Boolean>>(_initialBooleanValuesSectionClient, SWT.NONE);
        _itemBooleanValuesModel = new PrimitiveTypeBeanListTableModel<Boolean>(true);
        _itemBooleanValuesModel.addListener(new BeanListTableModelListener() {
           
            public void update(Object bean) {
                _model.fireModelChanged();               
            }
           
            public void remove(Object bean) {
                _model.fireModelChanged();
            }
           
            public void refresh(List beans) {
            }
           
            public void add(Object bean) {
                _model.fireModelChanged();               
            }
        });
        _tblItemBooleanValues.init(new String[] {"#", "Value"}, _itemBooleanValuesModel);
        cellEditors = new CellEditor[2];
        cellEditors[0] = null;
        cellEditors[1] = new CheckboxCellEditor(_tblItemBooleanValues.getTable());
        _tblItemBooleanValues.getTableViewer().setCellEditors(cellEditors);       
       
        _tblItemBooleanValues.getButton(EditableTableControl.BUTTON_ADD).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                WGContentItemDefinitionModel model = (WGContentItemDefinitionModel)_subformModels.get(SUBFORM_CONTENT_ITEM_DEFINITION);
                if (_itemBooleanValuesModel.getBeans().size() > 0) {                   
                    _chkItemList.setSelection(true);
                    model.setList(true);
                }
                handleAdd(_tblItemBooleanValues, false);               
            }
        });

        _tblItemBooleanValues.getButton(EditableTableControl.BUTTON_REMOVE).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleRemove(_tblItemBooleanValues);
            }
        });
       
       
        // item subform - number values
        _initialNumberValuesSectionClient = toolkit.createComposite(_initialValuesSection);
        _initialNumberValuesSectionClient.setLayout(new FillLayout());
        _tblItemNumberValues = new EditableTableControl<PrimitiveTypeBean<Number>>(_initialNumberValuesSectionClient, SWT.NONE);        
        _itemNumberValuesModel = new PrimitiveTypeBeanListTableModel<Number>(true);
        _itemNumberValuesModel.addListener(new BeanListTableModelListener() {
           
            public void update(Object bean) {
                _model.fireModelChanged();               
            }
           
            public void remove(Object bean) {
                _model.fireModelChanged();
            }
           
            public void refresh(List beans) {
            }
           
            public void add(Object bean) {
                _model.fireModelChanged();               
            }
        });
        _tblItemNumberValues.init(new String[] {"#", "Value"}, _itemNumberValuesModel);
        cellEditors = new CellEditor[2];
        cellEditors[0] = null;
        cellEditors[1] = new DoubleValueCellEditor(_tblItemNumberValues.getTable());

        _tblItemNumberValues.getTableViewer().setCellEditors(cellEditors);
       
        _tblItemNumberValues.getButton(EditableTableControl.BUTTON_ADD).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                WGContentItemDefinitionModel model = (WGContentItemDefinitionModel)_subformModels.get(SUBFORM_CONTENT_ITEM_DEFINITION);
                if (_itemNumberValuesModel.getBeans().size() > 0) {                   
                    _chkItemList.setSelection(true);
                    model.setList(true);
                }
                handleAdd(_tblItemNumberValues, 0);               
            }
        });

        _tblItemNumberValues.getButton(EditableTableControl.BUTTON_REMOVE).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleRemove(_tblItemNumberValues);
            }
        });
       
       
       
        itemTypeCombo.addModifyListener(new ModifyListener() {
           
            public void modifyText(ModifyEvent e) {
                WGContentItemDefinitionModel model = (WGContentItemDefinitionModel)_subformModels.get(SUBFORM_CONTENT_ITEM_DEFINITION);
                WGContentItemDefinition.Type type = model.getType().getKey();
                if (type.equals(WGContentItemDefinition.Type.TEXT)) {
                    _initialValuesSection.setVisible(true);
                    _lblInitialValues.setVisible(true);
                    _itemTextValuesModel.bind(model.getInitialValues());
                    _initialTextValuesSectionClient.setVisible(true);
                    _initialBooleanValuesSectionClient.setVisible(false);
                    _initialNumberValuesSectionClient.setVisible(false);
                    _initialValuesSection.setClient(_initialTextValuesSectionClient);
                    _initialValuesSection.layout();
                } else if (type.equals(WGContentItemDefinition.Type.BOOLEAN)) {
                    _initialValuesSection.setVisible(true);
                    _lblInitialValues.setVisible(true);
                    _itemBooleanValuesModel.bind(model.getInitialValues());
                    _initialBooleanValuesSectionClient.setVisible(true);
                    _initialTextValuesSectionClient.setVisible(false);
                    _initialNumberValuesSectionClient.setVisible(false);
                    _initialValuesSection.setClient(_initialBooleanValuesSectionClient);
                    _initialValuesSection.layout();
                } else if (type.equals(WGContentItemDefinition.Type.NUMBER)) {
                    _initialValuesSection.setVisible(true);
                    _lblInitialValues.setVisible(true);
                    _itemNumberValuesModel.bind(model.getInitialValues());
                    _initialNumberValuesSectionClient.setVisible(true);
                    _initialBooleanValuesSectionClient.setVisible(false);
                    _initialTextValuesSectionClient.setVisible(false);     
                    _initialValuesSection.setClient(_initialNumberValuesSectionClient);
                    _initialValuesSection.layout();
                } else {
                    _initialValuesSection.setVisible(false);
                    _lblInitialValues.setVisible(false);
                }
               
            }
        });
       
        WGContentItemDefinitionModel contentItemDefinitionModel = new WGContentItemDefinitionModel(_model);       
        contentItemDefinitionModel.addListener(new BeanChangedListener<WGContentItemDefinition>() {
            public void changed(WGContentItemDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }           
        });

       
        _subforms.put(SUBFORM_CONTENT_ITEM_DEFINITION, subform);
        _subformModels.put(SUBFORM_CONTENT_ITEM_DEFINITION, contentItemDefinitionModel);

        // content type meta data subforms
        // subform for description
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);       

        parentGroup = createParentInformationGroup(subform);
        parentInfoLayoutData = new GridData(GridData.FILL_HORIZONTAL);       
        parentInfoLayoutData.horizontalSpan = 2;
        parentGroup.setLayoutData(parentInfoLayoutData);
       
        txtName = factory.createText(subform, "Property:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        txtName.setEditable(false);
        Text txtValue = factory.createTextArea(subform, "Description", "description");       
        GridData txtValueLayoutData = new GridData(GridData.FILL_BOTH);
        txtValueLayoutData.minimumHeight = 200;
        txtValue.setLayoutData(txtValueLayoutData)
       
        WGDescriptionMetaFieldDefinitionModel descriptionMetaFieldDefinitionModel = new WGDescriptionMetaFieldDefinitionModel(_model);
        descriptionMetaFieldDefinitionModel.addListener(new BeanChangedListener<WGMetaFieldDefinition>() {
            public void changed(WGMetaFieldDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }
        });
       
        _subforms.put(SUBFORM_META_DESCRIPTION, subform);
        _subformModels.put(SUBFORM_META_DESCRIPTION, descriptionMetaFieldDefinitionModel);
       
        // subform for event scripts
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);       

        parentGroup = createParentInformationGroup(subform);
        parentInfoLayoutData = new GridData(GridData.FILL_HORIZONTAL);       
        parentInfoLayoutData.horizontalSpan = 2;
        parentGroup.setLayoutData(parentInfoLayoutData);
       
        txtName = factory.createText(subform, "Property:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        txtName.setEditable(false);
        txtValue = factory.createTextArea(subform, "Scriptcode:", "code");       
        txtValueLayoutData = new GridData(GridData.FILL_BOTH);
        txtValueLayoutData.minimumHeight = 200;
        txtValue.setLayoutData(txtValueLayoutData)
       
        WGEventScriptMetaFieldDefinitionModel eventScriptMetaFieldDefinitionModel = new WGEventScriptMetaFieldDefinitionModel(_model);
        eventScriptMetaFieldDefinitionModel.addListener(new BeanChangedListener<WGMetaFieldDefinition>() {
            public void changed(WGMetaFieldDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }
        });

       
        _subforms.put(SUBFORM_META_EVENTSCRIPT, subform);
        _subformModels.put(SUBFORM_META_EVENTSCRIPT, eventScriptMetaFieldDefinitionModel);
       
        // subform for layouts
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 3;
        subform.setLayout(subformLayout);
               
        parentGroup = createParentInformationGroup(subform);
        parentInfoLayoutData = new GridData(GridData.FILL_HORIZONTAL);       
        parentInfoLayoutData.horizontalSpan = 3;
        parentGroup.setLayoutData(parentInfoLayoutData);
       
        txtName = factory.createText(subform, "Property:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        txtName.setEditable(false);
        factory.addFiller(subform);
        txtValue = factory.createText(subform, "Module:", "layout");              
        txtValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
       
        final Text fTxtLayout = txtValue;
        Button btnBrowseLayout = new Button(subform, SWT.PUSH);
        btnBrowseLayout.setText("browse ...");
        btnBrowseLayout.addSelectionListener(new SelectionListener() {
           
            public void widgetSelected(SelectionEvent e) {
                handleBrowserLayout(fTxtLayout)
            }
           
            public void widgetDefaultSelected(SelectionEvent e) {                            
            }
        });
        WGLayoutMetaFieldDefinitionModel layoutMetaFieldDefinitionModel = new WGLayoutMetaFieldDefinitionModel(_model);
        layoutMetaFieldDefinitionModel.addListener(new BeanChangedListener<WGMetaFieldDefinition>() {
            public void changed(WGMetaFieldDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }
        });

       
        _subforms.put(SUBFORM_META_LAYOUT, subform);
        _subformModels.put(SUBFORM_META_LAYOUT, layoutMetaFieldDefinitionModel);
       
        // subform for allowed positions
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);
               
        parentGroup = createParentInformationGroup(subform);
        parentInfoLayoutData = new GridData(GridData.FILL_HORIZONTAL);       
        parentInfoLayoutData.horizontalSpan = 2;
        parentGroup.setLayoutData(parentInfoLayoutData);
       
        txtName = factory.createText(subform, "Property:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        txtName.setEditable(false);
        Combo comboPositioning = factory.createCombo(subform, "Positions:", "positioning");              
        comboPositioning.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
       
        factory.addFiller(subform);
        _tblAllowedPositions = new EditableTableControl<PrimitiveTypeBean<String>>(subform, SWT.NONE);
        _allowedPositionsModel = new PrimitiveTypeBeanListTableModel<String>();
        _allowedPositionsModel.addListener(new BeanListTableModelListener() {
           
            public void update(Object bean) {
                _model.fireModelChanged();               
            }
           
            public void remove(Object bean) {
                _model.fireModelChanged();
            }
           
            public void refresh(List beans) {
            }
           
            public void add(Object bean) {
                _model.fireModelChanged();               
            }
        });
        _tblAllowedPositions.init(new String[] {"Name"}, _allowedPositionsModel);
        GridData tblLayoutData = new GridData(GridData.FILL_BOTH);
        tblLayoutData.minimumHeight = 200;
        _tblAllowedPositions.setLayoutData(tblLayoutData);
        cellEditors = new CellEditor[1];
        cellEditors[0] = new TextCellEditor(_tblAllowedPositions.getTable());
        _tblAllowedPositions.getTableViewer().setCellEditors(cellEditors);
       
        comboPositioning.addModifyListener(new ModifyListener() {
           
            public void modifyText(ModifyEvent e) {
                WGPositioningMetaFieldDefinitionModel model = (WGPositioningMetaFieldDefinitionModel)_subformModels.get(SUBFORM_META_POSITIONING);
                if (model.getPositioning().getKey().equals(WGContentType.POSITIONING_FIXEDPARENTS) || model.getPositioning().getKey().equals(WGContentType.POSITIONING_FIXEDPARENTTYPES)) {
                    _tblAllowedPositions.setVisible(true);
                    WGContentTypeDefinition cTypeDefinition = _model.findContentTypeDefinition(model.getBean());                   
                    ((PrimitiveTypeBeanListTableModel<String>)_tblAllowedPositions.getModel()).bind(model.getAllowedPositions(cTypeDefinition));
                } else {
                    _tblAllowedPositions.setVisible(false);
                }
            }
        });

        _tblAllowedPositions.getButton(EditableTableControl.BUTTON_ADD).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleAdd(_tblAllowedPositions, "<value>");
            }
        });

        _tblAllowedPositions.getButton(EditableTableControl.BUTTON_REMOVE).addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleRemove(_tblAllowedPositions);
            }
        });
       
           
        WGPositioningMetaFieldDefinitionModel positioningMetaFieldDefinitionModel = new WGPositioningMetaFieldDefinitionModel(_model);
        positioningMetaFieldDefinitionModel.addListener(new BeanChangedListener<WGMetaFieldDefinition>() {
            public void changed(WGMetaFieldDefinition bean) {
                _treeViewer.refresh(bean, true);
                _model.fireModelChanged();
            }
        });

       
        _subforms.put(SUBFORM_META_POSITIONING, subform);
        _subformModels.put(SUBFORM_META_POSITIONING, positioningMetaFieldDefinitionModel);
       
       
        // subform for editors
        subform = toolkit.createComposite(_detailSection);
        subformLayout = new GridLayout();  
        subformLayout.numColumns = 2;
        subform.setLayout(subformLayout);
               
        parentGroup = createParentInformationGroup(subform);
        parentInfoLayoutData = new GridData(GridData.FILL_HORIZONTAL);       
        parentInfoLayoutData.horizontalSpan = 2;
        parentGroup.setLayoutData(parentInfoLayoutData);
       
        txtName = factory.createText(subform, "Property:", "name");
        txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        txtName.setEditable(false);
        Label label = new Label(subform, SWT.NONE);
        label.setText("Editors:");
        label.setLayoutData(new GridData(SWT.NONE, SWT.BEGINNING, false, false));
        _tblEditors = new EditableTableControl<PrimitiveTypeBean<String>>(subform, SWT.NONE);
        _editorsModel = new PrimitiveTypeBeanListTableModel<String>();
       
        _editorsModel.addListener(new BeanListTableModelListener() {
           
View Full Code Here

    private Group createParentInformationGroup(Composite subform) {
        Group parentInfo = new Group(subform, SWT.BORDER);
        parentInfo.setLayout(new GridLayout(2, false));
        parentInfo.setText("Parent");
       
        Label lblContentTypeName = new Label(parentInfo, SWT.NONE);
        lblContentTypeName.setText("Contenttype:");
        Text txtContentTypeName = new Text(parentInfo, SWT.NONE);
        txtContentTypeName.setEditable(false);
        txtContentTypeName.setData("contentTypeName");
        txtContentTypeName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
 
        Label lblActions = new Label(parentInfo, SWT.NONE);
        lblActions.setText("Actions:");
        HyperlinkGroup parentActionGroup = new HyperlinkGroup(Display.getCurrent());
        Hyperlink defineMetas = new Hyperlink(parentInfo, SWT.NONE);
        defineMetas.setText("add properties...");
        defineMetas.addHyperlinkListener(new IHyperlinkListener() {
           
            public void linkExited(HyperlinkEvent e) {
                // TODO Auto-generated method stub
               
            }
           
            public void linkEntered(HyperlinkEvent e) {
                // TODO Auto-generated method stub
               
            }
           
            public void linkActivated(HyperlinkEvent e) {
                handleAddMetaDataDefinition();               
            }
        });
        parentActionGroup.add(defineMetas);
        Label lbl = new Label(parentInfo, SWT.NONE);
        Hyperlink defineItems = new Hyperlink(parentInfo, SWT.NONE);
        defineItems.setText("add item definition...");
        defineItems.addHyperlinkListener(new IHyperlinkListener() {
           
            public void linkExited(HyperlinkEvent e) {
View Full Code Here

  protected Control createContents(Composite parent) {   
    Composite composite = new Composite(parent, SWT.FILL);
    composite.setLayout(new GridLayout(2, false));

    if (getDesignRoot() == null) {
      Label label = new Label(composite, SWT.None);
      label.setText("Note:");
      label = new Label(composite, SWT.None);
      label.setText("The selected resource is no wga design.");
      noDefaultAndApplyButton();
    } else {
      Label label = new Label(composite, SWT.None);
      label.setText("Development language:");
      _comboLanguage = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
     
      // fill combo
      List<String> languages = new ArrayList<String>();
      WGADesignStructureHelper helper = new WGADesignStructureHelper(getDesignRoot());
      try {
        languages.addAll(helper.getAvailableLableLanguages());         
      } catch (CoreException e) {
        Plugin.getDefault().getLog().log(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unable to retrieve configured label languages.", e));
      }
      if (languages.isEmpty()) {
        languages.add(WGADesignStructureHelper.DEFAULT_DESIGN_DEV_LANGUAGE);
      }
      _comboLanguage.setItems(languages.toArray(new String[0]));
     
      // set combo default     
      int index = 0;     
      try {
        String devLang = helper.getDevelopmentLanguage();
        int pos = _comboLanguage.indexOf(devLang);
        if (pos != -1) {
          index = pos;
        }
      } catch (CoreException e) {
        Plugin.getDefault().getLog().log(new Status(Status.ERROR, Plugin.PLUGIN_ID, "Unable to retrieve dev language of resource '" + getDesignRoot().getLocation() + "'.", e));
      }     
      _comboLanguage.select(index);
     
      label = new Label(composite, SWT.None);
      label.setText("AutoSort label files:");
     
      _chkSortLabelFiles = new Button(composite, SWT.CHECK);
      _chkSortLabelFiles.setText("enabled");
      _chkSortLabelFiles.setSelection(helper.isSortLabelFiles());
    }   
View Full Code Here

//      _txtMaxPerm = factory.createText(sectionClient, "Maximum java permgen size (in MB):", "maxPermSize");
//      _txtMaxPerm.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
     

     
    Label lbl = toolkit.createLabel(sectionClient, "Additional jvm options:");
      lbl.setLayoutData(new GridData(GridData.BEGINNING));
      _txtJvmOptions = toolkit.createText(sectionClient, "", SWT.MULTI|SWT.BORDER|SWT.V_SCROLL);
      _txtJvmOptions.setData("jvmOptions");
      GridData jvmOptionLayout = new GridData(GridData.FILL_BOTH);
      jvmOptionLayout.minimumHeight = WidgetFactory.computeFontHeight(_txtJvmOptions) * 5;
      _txtJvmOptions.setLayoutData(jvmOptionLayout);
View Full Code Here

    GridData compositeStyle = new GridData(SWT.FILL, SWT.FILL, true, true);
    _composite.setLayoutData(compositeStyle);
    GridLayout layout = new GridLayout(2, false);
    _composite.setLayout(layout);
   
    Label lblSymbolicName = new Label(_composite, SWT.None);
    lblSymbolicName.setText("Symbolic name:");
    _txtSymbolicName = new Text(_composite, SWT.BORDER);
    GridData txtStyle = new GridData(GridData.FILL_HORIZONTAL);
    txtStyle.minimumWidth = convertWidthInCharsToPixels(60);
    _txtSymbolicName.setLayoutData(txtStyle);
   
   
    if (_deployment != null) {
      _txtSymbolicName.setText(_deployment.getName());
      _txtSymbolicName.setEditable(false);     
    } else {
      _txtSymbolicName.addModifyListener(this)
    }
   
//    Label filler = new Label(composite, SWT.None);
//    filler.setText("");
   
    Group group = new Group(_composite, SWT.BORDER);
    group.setText("Specify an WGA distribution");
    GridData groupData = new GridData(GridData.FILL_BOTH);
    groupData.horizontalSpan = 2;
    group.setLayoutData(groupData);
    group.setLayout(new GridLayout(3, false));
   
    GridData optionStyle = new GridData();
    optionStyle.horizontalSpan = 3;
    _optionDownload = new Button(group, SWT.RADIO);
    _optionDownload.setText("Download latest WGA release from \n'" + WGADesignerPlugin.getDefault().getWGADownloadURL().toString() + "'.");
    _optionDownload.setLayoutData(GridDataFactory.copyData(optionStyle));
    _optionDownload.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        dialogchanged();
      }
     
    });
       
   
    _optionLocalFile = new Button(group, SWT.RADIO);
    _optionLocalFile.setText("Use local WGA war file ...");
    _optionLocalFile.setLayoutData(GridDataFactory.copyData(optionStyle));
   
    _optionLocalFile.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        dialogchanged();
      }
     
    });
   
    _lblFileLocation = new Label(group, SWT.None);
        _lblFileLocation.setText("File:");
        _txtFileLocation = new Text(group, SWT.BORDER);
        _txtFileLocation.setLayoutData(GridDataFactory.copyData(txtStyle));
        _txtFileLocation.addModifyListener(this);
       
        if (_deployment != null) {
            _txtFileLocation.setFocus();
        }
       
        _btnBrowse = new Button(group, SWT.PUSH);
        _btnBrowse.setText("...");
        _btnBrowse.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                handleBrowse();
            }  
        });
   

      _optionCustomURL  = new Button(group, SWT.RADIO);
        _optionCustomURL.setText("Download from ...");
        _optionCustomURL.setLayoutData(GridDataFactory.copyData(optionStyle));
        _optionCustomURL.addSelectionListener(new SelectionAdapter() {
           
            @Override
            public void widgetSelected(SelectionEvent e) {
                dialogchanged();
            }
           
        });
       
        _lblCustumURL = new Label(group, SWT.None);
        _lblCustumURL.setText("URL:");
        _txtCustomURL = new Text(group, SWT.BORDER);
        GridData data = GridDataFactory.copyData(txtStyle);
        data.horizontalSpan = 2;
        _txtCustomURL.setLayoutData(data);
View Full Code Here

    Composite composite = (Composite) super.createDialogArea(parent);
    composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
    GridLayout layout = new GridLayout(3, false);
    composite.setLayout(layout);

    Label messageLabel = createMessageArea(composite);
    _treeViewer = createTreeViewer(composite);
    GridData gridDataLabel = new GridData(GridData.FILL_HORIZONTAL);
    gridDataLabel.horizontalSpan = 3;

    messageLabel.setLayoutData(gridDataLabel);
    GridData gridDataTree = new GridData(GridData.FILL_BOTH);
    gridDataTree.horizontalSpan = 3;
    gridDataTree.widthHint = convertWidthInCharsToPixels(80);
    gridDataTree.heightHint = convertHeightInCharsToPixels(20);
    Tree treeWidget = _treeViewer.getTree();
View Full Code Here

    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    container.setLayout(layout);
   
    Label label = new Label(container, SWT.NONE);
    label.setText("Remote location (root url to WGA server):");   
    _txtRemoteLocation = new Text(container, SWT.BORDER);
    _txtRemoteLocation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));   
   
    if (_runtime != null) {
      URL remoteLocation = _runtime.getConfiguration().getRemoteLocation();
      if (remoteLocation != null) {
        _txtRemoteLocation.setText(remoteLocation.toString());
      }
    }
   
    label = new Label(container, SWT.NONE);
    label.setText("User (must have administrative rights):");
    _txtUser = new Text(container, SWT.BORDER);
    _txtUser.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if (_txtRemoteLocation.getText().trim().length() > 0) {
      _txtUser.setFocus();
    }
   
    label = new Label(container, SWT.NONE);
    label.setText("Password:");
    _txtPassword = new Text(container, SWT.BORDER | SWT.PASSWORD);
    _txtPassword.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   

   
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Label

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.