Ejemplo n.º 1
0
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 @Override
 public void setVisible(boolean visible) {
   super.setVisible(visible);
   if (visible) {
     if (initialObjectField.getItemCount() == 1) {
       initialObjectField.clearSelection();
       encodingField.setFocus();
     } else {
       encodingField.clearSelection();
       initialObjectField.setFocus();
     }
   }
 }
Ejemplo n.º 2
0
  /*
   * Implements method from IDialogPage
   */
  @Override
  public void setVisible(boolean visible) {
    if (visible && fPattern != null) {
      if (fFirstTime) {
        fFirstTime = false;
        // Set item and text here to prevent page from resizing
        fPattern.setItems(getPreviousSearchPatterns());
        fExtensions.setItems(fPreviousExtensions);
        //				if (fExtensions.getItemCount() == 0) {
        //					loadFilePatternDefaults();
        //				}
        if (!initializePatternControl()) {
          fPattern.select(0);
          fExtensions.setText("*"); // $NON-NLS-1$
          handleWidgetSelected();
        }
      }
      fPattern.setFocus();
    }
    updateOKStatus();

    IEditorInput editorInput = getContainer().getActiveEditorInput();
    getContainer()
        .setActiveEditorCanProvideScopeSelection(
            editorInput != null && editorInput.getAdapter(IFile.class) != null);

    super.setVisible(visible);
  }
  /**
   * Create contents of the wizard.
   *
   * @param parent
   */
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);

    setControl(container);
    container.setLayout(new GridLayout(1, false));

    Composite composite = new Composite(container, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));

    Label lblMetaModelThe = new Label(composite, SWT.NONE);
    GridData gd_lblMetaModelThe = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelThe.widthHint = 270;
    lblMetaModelThe.setLayoutData(gd_lblMetaModelThe);
    lblMetaModelThe.setText("Meta model the Helper conforms to:");

    comboMM = new Combo(composite, SWT.NONE);
    GridData gd_comboMM = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboMM.widthHint = 330;
    comboMM.setLayoutData(gd_comboMM);

    Composite composite_1 = new Composite(container, SWT.NONE);
    composite_1.setLayout(new GridLayout(2, false));

    Label lblMetaModelType = new Label(composite_1, SWT.NONE);
    GridData gd_lblMetaModelType = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelType.widthHint = 270;
    lblMetaModelType.setLayoutData(gd_lblMetaModelType);
    lblMetaModelType.setText("Meta model type of the input port:");

    comboInput = new Combo(composite_1, SWT.NONE);
    comboInput.setEnabled(false);
    GridData gd_comboInput = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboInput.widthHint = 330;
    comboInput.setLayoutData(gd_comboInput);

    Composite composite_2 = new Composite(container, SWT.NONE);
    composite_2.setLayout(new GridLayout(2, false));

    Label lblMetaModelType_1 = new Label(composite_2, SWT.NONE);
    GridData gd_lblMetaModelType_1 = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
    gd_lblMetaModelType_1.widthHint = 270;
    lblMetaModelType_1.setLayoutData(gd_lblMetaModelType_1);
    lblMetaModelType_1.setText("Meta model type of the output port:");

    comboOutput = new Combo(composite_2, SWT.NONE);
    comboOutput.setEnabled(false);
    GridData gd_comboOutput = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_comboOutput.widthHint = 330;
    comboOutput.setLayoutData(gd_comboOutput);

    setComboMM();
    comboMM.setFocus();
    comboMM.addListener(SWT.Modify, this);
    comboInput.addListener(SWT.Modify, this);
    comboOutput.addListener(SWT.Modify, this);

    this.setPageComplete(false);
  }
Ejemplo n.º 4
0
 protected void okPressed() {
   if ("".equals(sourceItemCombo.getText()) || SELECT_SENTENCE.equals(sourceItemCombo.getText())) {
     MessageDialog.openInformation(this.getShell(), "提示", "请选择触发项");
     sourceItemCombo.setFocus();
     return;
   }
   sourceItem = (MenuItem) sourceItemCombo.getData(sourceItemCombo.getText());
   super.okPressed();
 }
Ejemplo n.º 5
0
 /** @see org.teiid.designer.transformation.ui.builder.ILanguageObjectEditor#acceptFocus() */
 @Override
 public void acceptFocus() {
   if (isConversionType()) {
     cbxType.setFocus();
   } else if (currentControl == pnlNull) {
     cbxType.setFocus();
   } else if (currentControl == pnlBoolean) {
     if (rdbTrue.getSelection()) {
       rdbTrue.setFocus();
     } else {
       rdbFalse.setFocus();
     }
   } else if (currentControl == pnlText) {
     txfValue.setFocus();
   } else if (currentControl == pnlDate) {
     dateWidget.setFocus();
   }
 }
  private void onSelectMapProvider() {

    _selectedMp = _allMapProviders.get(_comboMapProvider.getSelectionIndex());

    updateZoomLevels();

    initOfflineManager();

    _comboMapProvider.setFocus();
  }
Ejemplo n.º 7
0
 /*
  * (non-Javadoc)
  * @see it.baeyens.avreclipse.ui.editors.targets.AbstractTCSectionPart#setFocus(java.lang.String)
  */
 @Override
 public boolean setFocus(String attribute) {
   if (attribute.equals(ATTR_MCU)) {
     if (fMCUcombo != null && !fMCUcombo.isDisposed()) {
       fMCUcombo.setFocus();
     }
     return true;
   }
   return false;
 }
Ejemplo n.º 8
0
  /* (non-Javadoc)
   * Method declared on Dialog.
   */
  @Override
  protected void createButtonsForButtonBar(Composite parent) {
    // create OK and Cancel buttons by default
    okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
    createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

    // do this here because setting the text will set enablement on the ok button
    combo.setFocus();
    combo.select(combo.indexOf(Boolean.toString(this.value)));
  }
Ejemplo n.º 9
0
 /*
  * Implements method from IDialogPage
  */
 @Override
 public void setVisible(final boolean visible) {
   if (visible && fPattern != null) {
     if (fFirstTime) {
       fFirstTime = false;
       // Set item and text here to prevent page from resizing
       fPattern.setItems(getPreviousSearchPatterns());
       try {
         initSelections();
       } catch (final ErlModelException e) {
       }
     }
     fPattern.setFocus();
   }
   updateOKStatus();
   super.setVisible(visible);
 }
Ejemplo n.º 10
0
  private void validar() throws Exception {
    boolean hayError = false;

    if (cbRubro.getSelectionIndex() == -1) {
      lbIconRubro.setVisible(true);
      hayError = true;
      cbRubro.setFocus();
    } else lbIconRubro.setVisible(false);

    if (txConcepto.getText().length() <= 0) {
      lbIconConcepto.setVisible(true);
      hayError = true;
      txConcepto.setFocus();
    } else lbIconConcepto.setVisible(false);

    if (hayError)
      throw new Exception("Existe un error en los datos ingresados, siga las indicaciones");
  }
  private void handleWidgetSelectedCategoryButton() {
    // Create a dialog allowing the user to input the category name
    NewCategoryNameDialog dialog =
        new NewCategoryNameDialog(PDEUserAssistanceUIPlugin.getActiveWorkbenchShell());
    dialog.create();
    dialog.getShell().setText(CSWizardMessages.RegisterCSWizardPage_descTooltip);

    if (dialog.open() == Window.OK) {
      String newCategoryName = dialog.getNameText();

      if (PDETextHelper.isDefinedAfterTrim(newCategoryName)) {
        String trimmedText = newCategoryName.trim();
        fCategoryCombo.add(trimmedText);
        fCategoryCombo.setText(trimmedText);
        fCategoryCombo.setFocus();
        String id = generateCategoryID(trimmedText);
        fCategoryTrackerUtil.associate(id, trimmedText, CSCategoryTrackerUtil.F_TYPE_NEW_CATEGORY);
      }
    }
  }
Ejemplo n.º 12
0
 /** {@inheritDoc} */
 @Override
 public void setFocus() {
   items.setFocus();
 }
    private void addDestinationControls(Composite composite) {
      fDestinationField = new Combo(composite, SWT.SINGLE | SWT.BORDER);
      SWTUtil.setDefaultVisibleItemCount(fDestinationField);
      fDestinationField.setFocus();
      fDestinationField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
      fDestinationField.setItems(
          (String[]) fgMruDestinations.toArray(new String[fgMruDestinations.size()]));
      fDestinationField.addModifyListener(
          new ModifyListener() {
            public void modifyText(ModifyEvent e) {
              handleDestinationChanged();
            }

            private void handleDestinationChanged() {
              IType declaring = getMoveProcessor().getDeclaringType();
              IJavaProject javaProject = declaring.getJavaProject();
              IStatus status =
                  JavaConventionsUtil.validateJavaTypeName(
                      fDestinationField.getText(), javaProject);
              if (status.getSeverity() == IStatus.ERROR) {
                error(status.getMessage());
              } else {
                try {
                  IType resolvedType = javaProject.findType(fDestinationField.getText());
                  if (resolvedType == null)
                    resolvedType =
                        javaProject.findType(
                            declaring.getPackageFragment().getElementName(),
                            fDestinationField.getText());
                  IStatus validationStatus =
                      validateDestinationType(resolvedType, fDestinationField.getText());
                  if (validationStatus.isOK()) {
                    setErrorMessage(null);
                    setPageComplete(true);
                  } else {
                    error(validationStatus.getMessage());
                  }
                } catch (JavaModelException ex) {
                  JavaPlugin.log(ex); // no ui here
                  error(RefactoringMessages.MoveMembersInputPage_invalid_name);
                }
              }
            }

            private void error(String message) {
              setErrorMessage(message);
              setPageComplete(false);
            }
          });
      if (fgMruDestinations.size() > 0) {
        fDestinationField.select(0);
      } else {
        setPageComplete(false);
      }
      JavaTypeCompletionProcessor processor = new JavaTypeCompletionProcessor(false, false, true);
      IPackageFragment context =
          (IPackageFragment)
              getMoveProcessor().getDeclaringType().getAncestor(IJavaElement.PACKAGE_FRAGMENT);
      processor.setPackageFragment(context);
      ControlContentAssistHelper.createComboContentAssistant(fDestinationField, processor);
      TextFieldNavigationHandler.install(fDestinationField);

      Button button = new Button(composite, SWT.PUSH);
      button.setText(RefactoringMessages.MoveMembersInputPage_browse);
      button.setLayoutData(new GridData());
      SWTUtil.setButtonDimensionHint(button);
      button.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
              openTypeSelectionDialog();
            }
          });
    }
 public void setVisible(boolean visible) {
   super.setVisible(visible);
   if (visible) {
     fileCombo.setFocus();
   }
 }
  protected Control createDialogArea(Composite parent) {

    String dialogTitle = HibernateConsoleMessages.AddPropertyDialog_add_exporter_property;
    String editTitle = HibernateConsoleMessages.AddPropertyDialog_add_property_to;
    if (flagEdit) {
      dialogTitle = HibernateConsoleMessages.AddPropertyDialog_edit_exporter_property;
      editTitle = HibernateConsoleMessages.AddPropertyDialog_edit_property_to;
    }
    getShell().setText(dialogTitle);
    setTitle(editTitle + ef.getExporterDefinition().getDescription());
    Composite control = (Composite) super.createDialogArea(parent);

    Composite composite = new Composite(control, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layout = new GridLayout(3, false);
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
    layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING);
    layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
    composite.setLayout(layout);

    Label label = new Label(composite, SWT.NONE);
    label.setText(HibernateConsoleMessages.AddPropertyDialog_name);
    final Combo combo = new Combo(composite, SWT.BORDER | SWT.DROP_DOWN);
    GridData pgd = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    pgd.horizontalSpan = 2;
    combo.setLayoutData(pgd);
    combo.setFocus();
    combo.addModifyListener(modifyListener);
    propertyCombo = new ComboViewer(combo);

    combo.addKeyListener(
        new KeyListener() {

          public void keyPressed(KeyEvent e) {}

          public void keyReleased(KeyEvent e) {
            if (e.keyCode == SWT.ARROW_UP || e.keyCode == SWT.ARROW_DOWN) {
              // linux doesn't call selectionChanged event on this events
              propertyCombo.setSelection(propertyCombo.getSelection(), false);
              return;
            }

            for (int i = 0; i < combo.getItemCount(); i++) {
              if (combo.getText().equals(combo.getItem(i))) {
                if (combo.getSelectionIndex() != i) {
                  combo.select(i);
                  propertyCombo.setSelection(propertyCombo.getSelection(), false);
                }
                return;
              }
            }
            disposeBrowseButton();
            createTextValueComposite(2);
          }
        });

    if (flagEdit) {
      propertyCombo.getControl().setEnabled(false);
    }

    label = new Label(composite, SWT.NONE);
    label.setText(HibernateConsoleMessages.AddPropertyDialog_value);

    value = new Text(composite, SWT.BORDER);
    value.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL));
    ((Text) value).addModifyListener(modifyListener);

    initDefaultNames(ef, propertyCombo);

    return control;
  }
Ejemplo n.º 16
0
 @Override
 public void setFocus() {
   displayType.setFocus();
 }