Package org.eclipse.jface.fieldassist

Examples of org.eclipse.jface.fieldassist.TextControlCreator


      }
    });

    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.package"));
    ContentAssistField packageField = new ContentAssistField(classGroup, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(), packageAssistProvider,
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
    packageName = (Text)packageField.getControl();
    packageField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    if(selection instanceof IPackageFragment){
      packageName.setText(((IPackageFragment)selection).getElementName());
    } else if(initPackage!=null && initPackage.length()!=0){
      packageName.setText(initPackage);
    } else if(getProject()!=null){
      String pagesPackage = ClickUtils.getPagePackageName(getProject());
      if(pagesPackage != null){
        packageName.setText(pagesPackage);
      }
    }
    packageName.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent e){
        validate();
      }
    });

    browsePackage = new Button(classGroup, SWT.PUSH);
    browsePackage.setText(ClickPlugin.getString("action.browse"));
    browsePackage.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(SelectionEvent evt){
        IRunnableContext context= new BusyIndicatorRunnableContext();
        int style = PackageSelectionDialog.F_REMOVE_DUPLICATES |
                    PackageSelectionDialog.F_SHOW_PARENTS |
                    PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE;

        JavaSearchScope scope = new JavaSearchScope();
        try {
          IJavaProject project = JavaCore.create(getProject());
          scope.add((JavaProject)project, JavaSearchScope.SOURCES, new HashSet<Integer>(2, 1));
        } catch(Exception ex){
          ClickPlugin.log(ex);
        }

        PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, style, scope);
        dialog.setMultipleSelection(false);
        if(dialog.open()==PackageSelectionDialog.OK){
          Object[] result = dialog.getResult();
          if(result.length >= 1){
            IPackageFragment fragment = (IPackageFragment)result[0];
            packageName.setText(fragment.getElementName());
          }
        }
      }
    });

    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.classname"));
    Composite classField = FieldAssistUtils.createNullDecoratedPanel(classGroup, false);
    className = new Text(classField, SWT.BORDER);
    classField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    className.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if(initClassName!=null){
      className.setText(initClassName);
    }
    className.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent e){
        validate();
      }
    });

    ClickUtils.createLabel(classGroup, "");

    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.superclass"));
    ContentAssistField superClassField = new ContentAssistField(classGroup, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(), typeAssistProvider,
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
    superClass = (Text)superClassField.getControl();
    superClassField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    superClass.setText(settings.get(NewClickPageWizard.SUPERCLASS));
    superClass.addModifyListener(new ModifyListener(){
View Full Code Here


    Composite composite = toolkit.createComposite(parent);
    composite.setLayout(FieldAssistUtils.createGridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    ContentAssistField field = new ContentAssistField(composite, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(),
        new TypeNameContentProposalProvider(project),
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS,
        new char[0]);

    final Text text = (Text)field.getControl();
View Full Code Here

    Composite composite = toolkit.createComposite(parent);
    composite.setLayout(FieldAssistUtils.createGridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    ContentAssistField field = new ContentAssistField(composite, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(),
        new TypeNameContentProposalProvider(project, packageName),
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS,
        new char[0]);

    final Text text = (Text) field.getControl();
View Full Code Here

      }
    });
   
    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.package"));
    ContentAssistField packageField = new ContentAssistField(classGroup, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(), packageAssistProvider,
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
    packageName = (Text)packageField.getControl();
    packageField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   
    if(selection instanceof IPackageFragment){
      packageName.setText(((IPackageFragment)selection).getElementName());
    } else if(initPackage!=null && initPackage.length()!=0){
      packageName.setText(initPackage);
    } else if(getProject()!=null){
      String pagesPackage = ClickUtils.getPagePackageName(getProject());
      if(pagesPackage != null){
        packageName.setText(pagesPackage);
      }
    }
    packageName.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent e){
        validate();
      }
    });
   
    browsePackage = new Button(classGroup, SWT.PUSH);
    browsePackage.setText(ClickPlugin.getString("action.browse"));
    browsePackage.addSelectionListener(new SelectionAdapter(){
      public void widgetSelected(SelectionEvent evt){
        IRunnableContext context= new BusyIndicatorRunnableContext();
        int style = PackageSelectionDialog.F_REMOVE_DUPLICATES |
                    PackageSelectionDialog.F_SHOW_PARENTS |
                    PackageSelectionDialog.F_HIDE_DEFAULT_PACKAGE;
       
        JavaSearchScope scope = new JavaSearchScope();
        try {
          IJavaProject project = JavaCore.create(getProject());
          scope.add((JavaProject)project, JavaSearchScope.SOURCES, new HashSet(2, 1));
        } catch(Exception ex){
          ClickPlugin.log(ex);
        }
       
        PackageSelectionDialog dialog = new PackageSelectionDialog(getShell(), context, style, scope);
        dialog.setMultipleSelection(false);
        if(dialog.open()==PackageSelectionDialog.OK){
          Object[] result = dialog.getResult();
          if(result.length >= 1){
            IPackageFragment fragment = (IPackageFragment)result[0];
            packageName.setText(fragment.getElementName());
          }
        }
      }
    });
   
    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.classname"));
    Composite classField = FieldAssistUtils.createNullDecoratedPanel(classGroup, false);
    className = new Text(classField, SWT.BORDER);
    classField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    className.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    if(initClassName!=null){
      className.setText(initClassName);
    }
    className.addModifyListener(new ModifyListener(){
      public void modifyText(ModifyEvent e){
        validate();
      }
    });
   
    ClickUtils.createLabel(classGroup, "");
   
    ClickUtils.createLabel(classGroup, ClickPlugin.getString("wizard.newPage.pageClassGroup.superclass"));
    ContentAssistField superClassField = new ContentAssistField(classGroup, SWT.BORDER,
        new TextControlCreator(), new TextContentAdapter(), typeAssistProvider,
        ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS, new char[0]);
    superClass = (Text)superClassField.getControl();
    superClassField.getLayoutControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    superClass.setText(settings.get(NewClickPageWizard.SUPERCLASS));
    superClass.addModifyListener(new ModifyListener(){
View Full Code Here

    glayout.marginTop = BORDER_MARGIN;
    glayout.marginBottom = BORDER_MARGIN;
    container.setLayout(glayout);

    messageField = new DecoratedField(container, SWT.READ_ONLY | style,
        new TextControlCreator());
    setFont(JFaceResources.getDialogFont());

    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    int lineHeight = ((Text) messageField.getControl()).getLineHeight();
    if ((style & SWT.WRAP) > 0)
View Full Code Here

      flowLabel.setText("Subflow");
    }

    // Create a decorated field with a required field decoration.
    DecoratedField flowField = new DecoratedField(nameGroup, SWT.SINGLE | SWT.BORDER,
        new TextControlCreator());
    FieldDecoration requiredFieldIndicator = FieldDecorationRegistry.getDefault()
        .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    flowField.addFieldDecoration(requiredFieldIndicator, SWT.TOP | SWT.LEFT, true);
    flowText = (Text) flowField.getControl();
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    flowField.getLayoutControl().setLayoutData(data);
    if (this.state != null && this.state.getFlow() != null) {
      this.flowText.setText(this.state.getFlow());
    }
    flowText.addModifyListener(new ModifyListener() {

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

    // add the indent after getting the decorated field
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalIndent = FieldDecorationRegistry.getDefault().getMaximumDecorationWidth();
    nameText.setLayoutData(data);

    DialogUtils.attachContentAssist(flowText, WebflowUtils.getWebflowConfigNames());

    browseFlowButton = new Button(nameGroup, SWT.PUSH);
    browseFlowButton.setText("...");
    browseFlowButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    browseFlowButton.addSelectionListener(buttonListener);

    if (!WebflowModelXmlUtils.isVersion1Flow(state)) {
      parentLabel = new Label(nameGroup, SWT.NONE);
      parentLabel.setText("Parent state id");
      parentText = new Text(nameGroup, SWT.SINGLE | SWT.BORDER);
      if (this.state != null && this.state.getParent() != null) {
        this.parentText.setText(this.state.getParent());
      }
      parentText.setLayoutData(data);
      parentText.addModifyListener(new ModifyListener() {

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

      new Label(nameGroup, SWT.NONE);
    }

    item1.setControl(groupActionType);

    // add attribute mapper

    item2.setText("Attribute Mapper");
    item2.setImage(WebflowUIImages.getImage(WebflowUIImages.IMG_OBJS_ATTRIBUTE_MAPPER));

    Composite attributeMapperGroup = new Composite(folder, SWT.NULL);
    attributeMapperGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
    layout1 = new GridLayout();
    layout1.numColumns = 1;
    layout1.marginWidth = 0;
    layout1.marginHeight = 0;
    attributeMapperGroup.setLayout(layout1);

    Group attributeMapperType = new Group(attributeMapperGroup, SWT.NULL);
    layoutAttMap = new GridLayout();
    layoutAttMap.marginWidth = 3;
    layoutAttMap.marginHeight = 3;
    attributeMapperType.setText(" Attribute Mapper ");
    attributeMapperType.setLayoutData(new GridData(GridData.FILL_BOTH));
    attributeMapperType.setLayout(layoutAttMap);

    Composite attributeMapperTypeGroup = new Composite(attributeMapperType, SWT.NULL);
    attributeMapperTypeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    layout1 = new GridLayout();
    layout1.numColumns = 3;
    layout1.marginWidth = 5;
    attributeMapperTypeGroup.setLayout(layout1);

    attributeMapperBeanLabel = new Label(attributeMapperTypeGroup, SWT.NONE);
    attributeMapperBeanLabel.setText("Bean");

    // Create a decorated field with a required field decoration.
    DecoratedField beanField = new DecoratedField(attributeMapperTypeGroup, SWT.SINGLE
        | SWT.BORDER, new TextControlCreator());
    FieldDecoration requiredFieldIndicator3 = FieldDecorationRegistry.getDefault()
        .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    beanField.addFieldDecoration(requiredFieldIndicator3, SWT.TOP | SWT.LEFT, true);
    attributeMapperBeanText = (Text) beanField.getControl();
    data = new GridData(GridData.FILL_HORIZONTAL);
View Full Code Here

    gridData.widthHint = LABEL_WIDTH;
    beanLabel.setLayoutData(gridData);
   
    // Create a decorated field with a required field decoration.
    DecoratedField beanField = new DecoratedField(nameGroup, SWT.SINGLE
        | SWT.BORDER, new TextControlCreator());
    FieldDecoration requiredFieldIndicator = FieldDecorationRegistry
        .getDefault().getFieldDecoration(
            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    beanField.addFieldDecoration(requiredFieldIndicator,
        SWT.TOP | SWT.LEFT, true);
View Full Code Here

    gridData.widthHint = LABEL_WIDTH;
    beanLabel.setLayoutData(gridData);

    // Create a decorated field with a required field decoration.
    DecoratedField beanField = new DecoratedField(nameGroup, SWT.SINGLE
        | SWT.BORDER, new TextControlCreator());
    FieldDecoration requiredFieldIndicator = FieldDecorationRegistry
        .getDefault().getFieldDecoration(
            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    beanField.addFieldDecoration(requiredFieldIndicator,
        SWT.TOP | SWT.LEFT, true);
    beanText = (Text) beanField.getControl();
    GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    beanField.getLayoutControl().setLayoutData(data);

    if (this.action != null && this.action.getBean() != null) {
      beanText.setText(this.action.getBean());
    }
    beanText.addModifyListener(new ModifyListener() {

      public void modifyText(ModifyEvent e) {
        if (validator != null) {
          validator.validateInput();
        }
      }
    });

    DialogUtils.attachContentAssist(beanText, WebflowUtils
        .getBeansFromEditorInput().toArray());

    browseBeanButton = new Button(nameGroup, SWT.PUSH);
    browseBeanButton.setText("...");
    browseBeanButton.setLayoutData(new GridData(
        GridData.HORIZONTAL_ALIGN_END));
    browseBeanButton.addSelectionListener(buttonListener);

    methodLabel = new Label(nameGroup, SWT.NONE);
    methodLabel.setText("Method");

    // Create a decorated field with a required field decoration.
    DecoratedField methodField = new DecoratedField(nameGroup, SWT.SINGLE
        | SWT.BORDER, new TextControlCreator());
    FieldDecoration requiredFieldIndicator1 = FieldDecorationRegistry
        .getDefault().getFieldDecoration(
            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
    methodField.addFieldDecoration(requiredFieldIndicator1, SWT.TOP
        | SWT.LEFT, true);
View Full Code Here

      gridData.widthHint = LABEL_WIDTH;
      beanLabel.setLayoutData(gridData);

      // Create a decorated field with a required field decoration.
      DecoratedField beanField = new DecoratedField(nameGroup, SWT.SINGLE | SWT.BORDER,
          new TextControlCreator());
      FieldDecoration requiredFieldIndicator = FieldDecorationRegistry.getDefault()
          .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
      beanField.addFieldDecoration(requiredFieldIndicator, SWT.TOP | SWT.LEFT, true);
      beanText = (Text) beanField.getControl();
      GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
      beanField.getLayoutControl().setLayoutData(data);

      if (this.action != null && this.action.getBean() != null) {
        beanText.setText(this.action.getBean());
      }
      beanText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
          if (validator != null) {
            validator.validateInput();
          }
        }
      });

      DialogUtils.attachContentAssist(beanText, WebflowUtils.getBeansFromEditorInput()
          .toArray());

      browseBeanButton = new Button(nameGroup, SWT.PUSH);
      browseBeanButton.setText("...");
      browseBeanButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
      browseBeanButton.addSelectionListener(buttonListener);

      methodLabel = new Label(nameGroup, SWT.NONE);
      methodLabel.setText("Method");

      // Create a decorated field with a required field decoration.
      DecoratedField methodField = new DecoratedField(nameGroup, SWT.SINGLE | SWT.BORDER,
          new TextControlCreator());
      FieldDecoration requiredFieldIndicator1 = FieldDecorationRegistry.getDefault()
          .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
      methodField.addFieldDecoration(requiredFieldIndicator1, SWT.TOP | SWT.LEFT, true);
      methodText = (Text) methodField.getControl();
      data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
View Full Code Here

TOP

Related Classes of org.eclipse.jface.fieldassist.TextControlCreator

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.