Пример #1
0
  private void createSelectionGroup() {
    String selectedMethodName = config.getMethodNode().getName();
    String selectedMethodVisibility =
        VisibilityNodeWrapper.getVisibilityName(config.getMethodVisibility());
    String selectedClassName = config.getSourceClassNode().getName();

    Group group = new Group(this, SWT.NONE);
    group.setLayout(new GridLayout());
    group.setText(Messages.FirstMoveMethodPageComposite_Selection);
    group.setLayoutData(getGridData(2, true));
    Label selectedMethodLabel = new Label(group, SWT.NONE);
    selectedMethodLabel.setText(
        Messages.FirstMoveMethodPageComposite_SelectedMethod + selectedMethodName);
    Label visibilityLabel = new Label(group, SWT.NONE);
    visibilityLabel.setText(
        Messages.FirstMoveMethodPageComposite_Visibility + selectedMethodVisibility);
    visibilityLabel.setLayoutData(getGridData(1, true));
    Label selcetecClassLabel = new Label(group, SWT.NONE);
    selcetecClassLabel.setText(
        Messages.FirstMoveMethodPageComposite_SelectedClass + selectedClassName);
    selcetecClassLabel.setLayoutData(getGridData(1, true));
  }
Пример #2
0
  private void createClassSelection() {
    Label moveToClassLabel = new Label(this, SWT.NONE);
    moveToClassLabel.setText(Messages.FirstMoveMethodPageComposite_MoveToClass);
    final Combo classSelectionCombo = new Combo(this, SWT.DROP_DOWN | SWT.READ_ONLY);
    classSelectionCombo.setVisibleItemCount(10);

    for (String aktClassName : config.getTargetClassNames()) {
      if (config.getDestinationClassNode() == null) {
        config.setDestinationClassNode(aktClassName);
      }
      classSelectionCombo.add(aktClassName);
    }
    classSelectionCombo.select(0);
    classSelectionCombo.addSelectionListener(
        new SelectionListener() {

          public void widgetDefaultSelected(SelectionEvent e) {}

          public void widgetSelected(SelectionEvent e) {
            config.setDestinationClassNode(classSelectionCombo.getText());
          }
        });
  }
Пример #3
0
  private void createLeaveDelegateMethodCheck() {
    final Button delegateCheck = new Button(this, SWT.CHECK);
    delegateCheck.setLayoutData(getGridData(2, true));
    delegateCheck.setText(
        Messages.FirstMoveMethodPageComposite_LeaveDelegate
            + config.getSourceClassNode().getName()
            + Messages.FirstMoveMethodPageComposite_DelegatesCalls
            + config.getMethodNode().getName()
            + "\"."); //$NON-NLS-1$
    delegateCheck.setSelection(config.leaveDelegateMethodInSource());
    if (config.canCreateDelegateMethod()) {
      delegateCheck.addSelectionListener(
          new SelectionListener() {

            public void widgetDefaultSelected(SelectionEvent e) {}

            public void widgetSelected(SelectionEvent e) {
              config.setLeaveDelegateMethodInSource(delegateCheck.getSelection());
            }
          });
    } else {
      delegateCheck.setEnabled(false);
    }
  }