Esempio n. 1
0
 private void initializeValues() {
   int index = sdmBackendCombo.getSelectionIndex();
   if (index >= 0) {
     String backend = sdmBackendCombo.getItem(index);
     sdmBackendPathText.setText(SDMDebugCorePlugin.getDefault().getDebuggerBackendPath(backend));
     sdmPathText.setText(SDMDebugCorePlugin.getDefault().getDebuggerSDMPath(backend));
   }
 }
Esempio n. 2
0
  /** @param parent */
  protected void createSDMSetting(Composite parent) {
    Composite group = createGroupComposite(parent, 1, false, Messages.SDMPreferencePage_1);
    Composite comp = createComposite(group, 2);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);

    new Label(comp, SWT.NONE).setText(Messages.SDMPreferencePage_2);
    sdmBackendCombo = new Combo(comp, SWT.READ_ONLY);
    sdmBackendCombo.setLayoutData(gd);
    sdmBackendCombo.setItems(SDMDebugCorePlugin.getDefault().getDebuggerBackends());
    sdmBackendCombo.addSelectionListener(listener);
    sdmBackendCombo.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            updateValues();
            storeValues();
          }
        });

    new Label(comp, SWT.NONE).setText(Messages.SDMPreferencePage_3);
    sdmBackendPathText = new Text(comp, SWT.SINGLE | SWT.BORDER);
    sdmBackendPathText.setLayoutData(gd);
    sdmBackendPathText.addModifyListener(listener);

    new Label(comp, SWT.NONE).setText(Messages.SDMPreferencePage_18);
    sdmPathText = new Text(comp, SWT.SINGLE | SWT.BORDER);
    sdmPathText.setLayoutData(gd);
    sdmPathText.addModifyListener(listener);

    Composite debugGroup = createGroupComposite(parent, 2, false, Messages.SDMPreferencePage_5);
    Composite sdmDebugComp = createComposite(debugGroup, 1);
    gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    sdmDebugComp.setLayoutData(gd);

    debugEnabledButton = new Button(sdmDebugComp, SWT.CHECK);
    debugEnabledButton.setText(Messages.SDMPreferencePage_6);
    debugEnabledButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            debugEnabled = debugEnabledButton.getSelection();
            PDebugOptions.setDebugging(PDebugOptions.DEBUG_MASTER_OUTPUT, true);
            updateDebugButtons();
          }
        });

    debugStartupButton = new Button(sdmDebugComp, SWT.CHECK);
    debugStartupButton.setText(Messages.SDMPreferencePage_7);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugStartupButton.setLayoutData(gd);
    debugStartupButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugStartupButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_STARTUP;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_STARTUP;
            }
          }
        });

    debugMessagesButton = new Button(sdmDebugComp, SWT.CHECK);
    debugMessagesButton.setText(Messages.SDMPreferencePage_8);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugMessagesButton.setLayoutData(gd);
    debugMessagesButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugMessagesButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_MESSAGES;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_MESSAGES;
            }
          }
        });

    debugRoutingButton = new Button(sdmDebugComp, SWT.CHECK);
    debugRoutingButton.setText(Messages.SDMPreferencePage_9);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugRoutingButton.setLayoutData(gd);
    debugRoutingButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugRoutingButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_ROUTING;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_ROUTING;
            }
          }
        });

    debugMasterButton = new Button(sdmDebugComp, SWT.CHECK);
    debugMasterButton.setText(Messages.SDMPreferencePage_17);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugMasterButton.setLayoutData(gd);
    debugMasterButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugMasterButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_MASTER;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_MASTER;
            }
          }
        });

    debugServerButton = new Button(sdmDebugComp, SWT.CHECK);
    debugServerButton.setText(Messages.SDMPreferencePage_10);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugServerButton.setLayoutData(gd);
    debugServerButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugServerButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_SERVER;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_SERVER;
            }
          }
        });

    debugBackendButton = new Button(sdmDebugComp, SWT.CHECK);
    debugBackendButton.setText(Messages.SDMPreferencePage_11);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugBackendButton.setLayoutData(gd);
    debugBackendButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugBackendButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_BACKEND;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_BACKEND;
            }
          }
        });

    debugProtocolButton = new Button(sdmDebugComp, SWT.CHECK);
    debugProtocolButton.setText(Messages.SDMPreferencePage_12);
    gd = new GridData();
    gd.horizontalIndent = 20;
    debugProtocolButton.setLayoutData(gd);
    debugProtocolButton.addSelectionListener(
        new SelectionListener() {
          public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
          }

          public void widgetSelected(SelectionEvent e) {
            if (debugProtocolButton.getSelection()) {
              debugLevel |= SDMPreferenceConstants.DEBUG_LEVEL_PROTOCOL;
            } else {
              debugLevel &= ~SDMPreferenceConstants.DEBUG_LEVEL_PROTOCOL;
            }
          }
        });

    updateDebugButtons();

    sdmBackendCombo.select(0);
    initializeValues();

    Dialog.applyDialogFont(parent);
  }