Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.ModifyListener


    Iterator iter = trackers.iterator();
    while (iter.hasNext()) {
      tracker.add((String) iter.next());
    }
   
    tracker.addModifyListener(new ModifyListener() {
      /*
       * (non-Javadoc)
       *
       * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
       */
 
View Full Code Here


           
            Text headerTabText = new Text(tabItemContainer, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
            headerTabText.setData(current);
            headerTabText.setText(_headerFileMap.get(current).getDefaultHeader());      
           
            headerTabText.addModifyListener(new ModifyListener() {               
                public void modifyText(ModifyEvent e) {
                    if(e.getSource() instanceof Text){
                        Text source = (Text)e.getSource();
                        _headerFileMap.get((String)source.getData()).setDefaultHeader(source.getText());
                    }                 
View Full Code Here

   
    final Text inclText = new Text(cBottom, SWT.BORDER);
    gd = new GridData();
    gd.widthHint = 200;
    inclText.setLayoutData(gd);
    inclText.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e) {
        String newExpression = inclText.getText();
        if (newExpression.length() == 0)
          inclusionFilter = null;
        else
        {
          try
          {
            inclusionFilter = Pattern.compile(newExpression, Pattern.CASE_INSENSITIVE);
            inclText.setBackground(null);
          } catch (PatternSyntaxException e1)
          {
            inclText.setBackground(Colors.colorErrorBG);
          }
        }
      }
    });
   
    label = new Label(cBottom, SWT.NONE);
    label.setLayoutData(new GridData());
    Messages.setLanguageText(label, "LoggerView.excludeAll");
       
    final Text exclText = new Text(cBottom, SWT.BORDER);
    gd = new GridData();
    gd.widthHint = 200;
    exclText.setLayoutData(gd);
    exclText.addModifyListener(new ModifyListener()
    {
      public void modifyText(ModifyEvent e) {
        String newExpression = exclText.getText();
        if (newExpression.length() == 0)
          exclusionFilter = null;
View Full Code Here

   
   
    String exportLocation = Plugin.getDefault().getPreferenceStore().getString(Preferences.PLUGIN_EXPORT_LOCATION);
    _txtExportLocation.setText(exportLocation);
   
    _txtExportLocation.addModifyListener(new ModifyListener() {

      public void modifyText(ModifyEvent e) {
        pageChanged();       
      }
     
    });
   
    _btnBrowse = new Button(container, SWT.None);
    _btnBrowse.setText("...");
    _btnBrowse.addSelectionListener(new SelectionAdapter() {

      @Override
      public void widgetSelected(SelectionEvent e) {
        handleBrowse();
      }
     
    });
   
   
    Label lblBuild = new Label(container, SWT.None);
    lblBuild.setText("Build:");
   
    _txtBuild = new Text(container, SWT.BORDER);
    _txtBuild.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    _txtBuild.setText(Integer.toString(getModel().getPluginBuild()));   
    _txtBuild.addModifyListener(new ModifyListener() {

      public void modifyText(ModifyEvent e) {
        pageChanged();     
      }
     
View Full Code Here

                headerTabText.setEnabled(false);
                _importButton.setEnabled(false);
                _exportButton.setEnabled(false);
            }

            headerTabText.addModifyListener(new ModifyListener() {
                public void modifyText(ModifyEvent e) {
                    if (e.getSource() instanceof Text) {
                        Text source = (Text) e.getSource();
                        if (_specificHeaderCheckbox.getSelection()) {
                            _headerFileMap.get((String) source.getData()).setSpecificHeader(_selectedProject, source.getText());
View Full Code Here

            }
        });
       
       
       
        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);
View Full Code Here

    GridData gridDataText = new GridData(GridData.FILL_HORIZONTAL);   
    new Label(composite, SWT.NONE).setText("Name :");
    _linkNameText = new Text(composite, SWT.BORDER);
    _linkNameText.setLayoutData(gridDataText);
    _linkNameText.addModifyListener(new ModifyListener() {

      public void modifyText(ModifyEvent e) {
        textModified();
      }

    });

    _combo = new Combo(composite, SWT.READ_ONLY);
    _combo.setItems(new String[] { "design", "plugin" });
    _combo.setEnabled(false);
    _combo.addModifyListener(new ModifyListener(){

      public void modifyText(ModifyEvent e) {
        textModified();       
      }
     
View Full Code Here

      final Text inclText = new Text(bottomSection, SWT.BORDER);
      gridData = new GridData();
      gridData.widthHint = 200;
      inclText.setLayoutData(gridData);
      inclText.addModifyListener(new ModifyListener()
      {
        public void modifyText(ModifyEvent e) {
          String newExpression = inclText.getText();
          if (newExpression.length() == 0)
            inclusionFilter = null;
          else
          {
            try
            {
              inclusionFilter = Pattern.compile(newExpression, Pattern.CASE_INSENSITIVE);
              inclText.setBackground(null);
            } catch (PatternSyntaxException e1)
            {
              inclText.setBackground(Colors.colorErrorBG);
            }
          }
        }
      });

      label = new Label(bottomSection, SWT.NONE);
     
        // exclude
     
      label = new Label(bottomSection, SWT.NONE);
      label.setLayoutData(new GridData());
      Messages.setLanguageText(label, "LoggerView.excludeAll");

      final Text exclText = new Text(bottomSection, SWT.BORDER);
      gridData = new GridData();
      gridData.widthHint = 200;
      exclText.setLayoutData(gridData);
      exclText.addModifyListener(new ModifyListener()
      {
        public void modifyText(ModifyEvent e) {
          String newExpression = exclText.getText();
          if (newExpression.length() == 0)
            exclusionFilter = null;
View Full Code Here

      new Label(parent, SWT.None).setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false, 2, 1));

      Control control = super.createButtonBar(parent);

      /* Update OK Button based on Input */
      fNameInput.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          getButton(IDialogConstants.OK_ID).setEnabled(fNameInput.getText().length() > 0);
        }
      });

View Full Code Here

      String initialLink = getInitialLink();
      fLinkInput = new Text(control, SWT.SINGLE | SWT.BORDER);
      fLinkInput.setText(initialLink);
      fLinkInput.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
      fLinkInput.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          setErrorMessage(null);
        }
      });

      if (StringUtils.isSet(initialLink) && !initialLink.equals(HTTP)) {
        fLinkInput.setText(initialLink);
        fLinkInput.selectAll();
      } else {
        fLinkInput.setText(HTTP);
        fLinkInput.setSelection(HTTP.length());
      }

      Label nameLabel = new Label(control, SWT.NONE);
      nameLabel.setText("Name: ");

      Composite nameContainer = new Composite(control, SWT.BORDER);
      nameContainer.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
      nameContainer.setLayout(LayoutUtils.createGridLayout(2, 0, 0));
      nameContainer.setBackground(control.getDisplay().getSystemColor(SWT.COLOR_WHITE));

      fNameInput = new Text(nameContainer, SWT.SINGLE);
      fNameInput.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
      fNameInput.addModifyListener(new ModifyListener() {
        public void modifyText(ModifyEvent e) {
          setErrorMessage(null);
        }
      });
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.ModifyListener

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.