private void createDialog(Shell applicationShell) {
    if (dialog == null || dialog.isDisposed()) {
      dialog = new Shell(applicationShell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.APPLICATION_MODAL);

      if (applicationShell.getImage() != null) {
        dialog.setImage(applicationShell.getImage());
      }

      dialog.addListener(
          SWT.Close,
          new Listener() {
            public void handleEvent(Event event) {
              hideCustomPanelChildren();
            }
          });

      dialog.addDisposeListener(
          new DisposeListener() {
            public void widgetDisposed(DisposeEvent arg0) {
              disposeImages();
            }
          });

      if (fileDialogMode != VFS_DIALOG_SAVEAS) {
        dialog.setText(Messages.getString("VfsFileChooserDialog.openFile")); // $NON-NLS-1$
      } else {
        dialog.setText(Messages.getString("VfsFileChooserDialog.saveAs")); // $NON-NLS-1$
      }
      dialog.setLayout(new GridLayout());
      dialog.setBackgroundMode(SWT.INHERIT_FORCE);
      dialog.setBackground(dialog.getDisplay().getSystemColor(SWT.COLOR_WHITE));
      createCustomUIPanel(dialog);
    }
  }
示例#2
0
 public void preserveValues(final Widget widget) {
   ControlLCAUtil.preserveValues((Control) widget);
   Shell shell = (Shell) widget;
   IWidgetAdapter adapter = WidgetUtil.getAdapter(shell);
   adapter.preserve(PROP_ACTIVE_CONTROL, getActiveControl(shell));
   adapter.preserve(PROP_ACTIVE_SHELL, shell.getDisplay().getActiveShell());
   adapter.preserve(PROP_TEXT, shell.getText());
   adapter.preserve(PROP_IMAGE, shell.getImage());
   adapter.preserve(PROP_ALPHA, new Integer(shell.getAlpha()));
   adapter.preserve(PROP_MODE, getMode(shell));
   adapter.preserve(PROP_FULLSCREEN, Boolean.valueOf(shell.getFullScreen()));
   adapter.preserve(PROP_SHELL_LISTENER, Boolean.valueOf(ShellEvent.hasListener(shell)));
   adapter.preserve(PROP_SHELL_MENU, shell.getMenuBar());
   adapter.preserve(PROP_MINIMUM_SIZE, shell.getMinimumSize());
   WidgetLCAUtil.preserveCustomVariant(shell);
 }
示例#3
0
 public int open() {
   Shell parent = this.getParent();
   shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
   shell.setText(getText());
   shell.setImage(parent.getImage());
   shell.setLayout(new GridLayout());
   createContentComposite(shell);
   createButtonBarComposite(shell);
   shell.pack();
   centerShell(parent, shell);
   shell.open();
   Display display = parent.getDisplay();
   while (!shell.isDisposed()) {
     if (!display.readAndDispatch()) display.sleep();
   }
   return result;
 }
示例#4
0
 private static void writeImage(final Shell shell) throws IOException {
   if ((shell.getStyle() & SWT.TITLE) != 0) {
     Image image = shell.getImage();
     if (image == null) {
       Image[] defaultImages = shell.getImages();
       if (defaultImages.length > 0) {
         image = defaultImages[0];
       }
     }
     if (WidgetLCAUtil.hasChanged(shell, PROP_IMAGE, image, null)) {
       //        JSWriter writer = JSWriter.getWriterFor( shell );
       //        writer.set( JSConst.QX_FIELD_ICON,
       //                    ResourceFactory.getImagePath( image ) );
       IWidgetSynchronizer synchronizer =
           WidgetSynchronizerFactory.getSynchronizerForWidget(shell);
       synchronizer.setWidgetProperty(JSConst.QX_FIELD_ICON, ResourceFactory.getImagePath(image));
     }
   }
 }
  /** @param shell the shell. */
  public OlapInputAboutDialog(final Shell shell) {
    this.dialog = new Shell(shell, SWT.BORDER | SWT.CLOSE | SWT.APPLICATION_MODAL | SWT.SHEET);
    GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 2;

    this.dialog.setLayout(gridLayout);
    this.dialog.setText(BaseMessages.getString(PKG, "OlapInputDialog.About.Shell.Title"));
    this.dialog.setImage(shell.getImage());

    this.buildIconCell();
    this.buildPluginInfoCell();
    this.buildOkButton();

    this.dialog.pack();
    Rectangle shellBounds = shell.getBounds();
    Point dialogSize = this.dialog.getSize();

    this.dialog.setLocation(
        shellBounds.x + (shellBounds.width - dialogSize.x) / 2,
        shellBounds.y + (shellBounds.height - dialogSize.y) / 2);
  }
示例#6
0
 public Image getImage() {
   return shell.getImage();
 }
  /**
   * Create the composite.
   *
   * @param parent
   * @param style
   */
  public ArgumentsDialog(
      final Shell parent, ExecutionConfiguration configuration, AbstractMeta abstractMeta) {
    super(parent);
    this.configuration = configuration;

    display = parent.getDisplay();
    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.APPLICATION_MODAL);
    props = PropsUI.getInstance();
    props.setLook(shell);
    shell.setImage(parent.getImage());
    shell.setLayout(new FormLayout());
    shell.setText(BaseMessages.getString(PKG, "ArgumentsDialog.Arguments.Label"));

    ColumnInfo[] cArguments = {
      new ColumnInfo(
          BaseMessages.getString(PKG, "ArgumentsDialog.ArgumentsColumn.Argument"),
          ColumnInfo.COLUMN_TYPE_TEXT,
          false,
          true,
          180), // Argument name
      new ColumnInfo(
          BaseMessages.getString(PKG, "ArgumentsDialog.ArgumentsColumn.Value"),
          ColumnInfo.COLUMN_TYPE_TEXT,
          false,
          false,
          172), // Actual value
    };

    int nrArguments =
        configuration.getArguments() != null ? configuration.getArguments().size() : 0;

    wArguments =
        new TableView(
            abstractMeta,
            shell,
            SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI,
            cArguments,
            nrArguments,
            false,
            null,
            props,
            false);

    FormData fd_argumentsTable = new FormData();
    fd_argumentsTable.top = new FormAttachment(0, 15);
    fd_argumentsTable.left = new FormAttachment(0, 15);
    fd_argumentsTable.bottom = new FormAttachment(0, 221);
    fd_argumentsTable.right = new FormAttachment(0, 371);
    wArguments.setLayoutData(fd_argumentsTable);

    Label separator = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    FormData fd_separator = new FormData();
    fd_separator.top = new FormAttachment(wArguments, 15);
    fd_separator.right = new FormAttachment(wArguments, 0, SWT.RIGHT);
    fd_separator.left = new FormAttachment(0, 15);
    separator.setLayoutData(fd_separator);

    Button okButton = new Button(shell, SWT.NONE);
    okButton.setText("OK");
    FormData fd_okButton = new FormData();
    fd_okButton.left = new FormAttachment(0, 269);
    okButton.setLayoutData(fd_okButton);
    okButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            ok();
          }
        });

    Button cancelButton = new Button(shell, SWT.NONE);
    fd_okButton.top = new FormAttachment(cancelButton, 0, SWT.TOP);
    fd_okButton.right = new FormAttachment(cancelButton, -4);
    cancelButton.setText("Cancel");
    FormData fd_cancelButton = new FormData();
    fd_cancelButton.top = new FormAttachment(separator, 13);
    fd_cancelButton.right = new FormAttachment(wArguments, 0, SWT.RIGHT);
    cancelButton.setLayoutData(fd_cancelButton);
    cancelButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            dispose();
          }
        });

    Button btnHelp = new Button(shell, SWT.NONE);
    btnHelp.setImage(GUIResource.getInstance().getImageHelpWeb());
    btnHelp.setText(BaseMessages.getString(PKG, "System.Button.Help"));
    btnHelp.setToolTipText(BaseMessages.getString(PKG, "System.Tooltip.Help"));
    FormData fd_btnHelp = new FormData();
    fd_btnHelp.top = new FormAttachment(separator, 13);
    fd_btnHelp.left = new FormAttachment(separator, 0, SWT.LEFT);
    btnHelp.setLayoutData(fd_btnHelp);
    btnHelp.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent evt) {
            String docUrl = BaseMessages.getString(Spoon.class, "Spoon.ArgumentsDialog.Help");
            String docTitle = BaseMessages.getString(PKG, "ArgumentsDialog.docTitle");
            String docHeader = BaseMessages.getString(PKG, "ArgumentsDialog.docHeader");
            HelpUtils.openHelpDialog(parent.getShell(), docTitle, docUrl, docHeader);
          }
        });

    shell.setSize(394, 319);
    getArgumentsData();
    shell.open();

    Rectangle shellBounds = getParent().getBounds();
    Point dialogSize = shell.getSize();

    shell.setLocation(
        shellBounds.x + (shellBounds.width - dialogSize.x) / 2,
        shellBounds.y + (shellBounds.height - dialogSize.y) / 2);

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
示例#8
0
  public RenameDialog(Shell parent, SourcesHandler handler, CopySource copy) {
    dialog = new Shell(parent, SWT.DIALOG_TRIM | SWT.CLOSE | SWT.APPLICATION_MODAL);
    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = 10;
    formLayout.marginHeight = 10;
    formLayout.spacing = 10;
    dialog.setLayout(formLayout);

    this.copySource = copy;
    this.handler = handler;

    ApplicationFactory factory = new ApplicationFactory(dialog, "Creator", getClass().getName());

    Label label = factory.createLabel("name"); // new Label (dialog, SWT.NONE);
    FormData data = new FormData();
    label.setLayoutData(data);

    Button cancel = factory.createButton("cancel");
    data = new FormData();
    data.width = 60;
    data.right = new FormAttachment(100, 0);
    data.bottom = new FormAttachment(100, 0);
    cancel.setLayoutData(data);
    cancel.addSelectionListener(
        new SelectionAdapter() {
          @SuppressWarnings("unused")
          public void widgetSelected(SelectionEvent e) {
            dialog.close();
          }
        });

    final Text text = new Text(dialog, SWT.BORDER);
    text.setText(copySource.getSrcNames()[0]);
    data = new FormData();
    data.width = 200;
    data.left = new FormAttachment(label, 0, SWT.DEFAULT);
    data.right = new FormAttachment(100, 0);
    data.top = new FormAttachment(label, 0, SWT.CENTER);
    data.bottom = new FormAttachment(cancel, 0, SWT.DEFAULT);
    text.setLayoutData(data);

    Button ok = new Button(factory.getComposite(), SWT.PUSH);
    ;
    ok.setText("Ok");
    data = new FormData();
    data.width = 60;
    data.right = new FormAttachment(cancel, 0, SWT.DEFAULT);
    data.bottom = new FormAttachment(100, 0);
    ok.setLayoutData(data);
    ok.addSelectionListener(
        new SelectionAdapter() {
          @SuppressWarnings("unused")
          public void widgetSelected(SelectionEvent e) {
            rename(text.getText());
          }
        });

    Rectangle displayRect = UIDATA.DISPLAY.getBounds();
    int x = (displayRect.width - 350) / 2;
    int y = (displayRect.height - 300) / 2;
    dialog.setImage(parent.getImage());
    dialog.setLocation(x, y);

    dialog.setDefaultButton(ok);
    dialog.pack();
    //    XPWindowTheme.setWin32Theme(dialog);
    dialog.open();
  }
示例#9
0
  @SuppressWarnings("unchecked")
  public void prepareForOpen() {
    Point contentsSize = contents.getSize();
    Point titleSize = new Point(0, 0);

    boolean showTitle = ((style & (SWT.CLOSE | SWT.TITLE)) != 0);
    if (showTitle) {
      if (titleLabel == null) {
        titleLabel = new Label(shell, SWT.NONE);
        titleLabel.setBackground(shell.getBackground());
        titleLabel.setForeground(shell.getForeground());
        FontData[] fds = shell.getFont().getFontData();
        for (int i = 0; i < fds.length; i++) {
          fds[i].setStyle(fds[i].getStyle() | SWT.BOLD);
        }
        final Font font = new Font(shell.getDisplay(), fds);
        titleLabel.addListener(
            SWT.Dispose,
            new Listener() {
              @Override
              public void handleEvent(Event event) {
                font.dispose();
              }
            });
        titleLabel.setFont(font);
        selectionControls.add(titleLabel);
      }
      String titleText = shell.getText();
      titleLabel.setText(titleText == null ? "" : titleText);
      titleLabel.pack();
      titleSize = titleLabel.getSize();

      final Image titleImage = shell.getImage();
      if (titleImageLabel == null && shell.getImage() != null) {
        titleImageLabel = new Canvas(shell, SWT.NONE);
        titleImageLabel.setBackground(shell.getBackground());
        titleImageLabel.setBounds(titleImage.getBounds());
        titleImageLabel.addListener(
            SWT.Paint,
            new Listener() {
              @Override
              public void handleEvent(Event event) {
                event.gc.drawImage(titleImage, 0, 0);
              }
            });
        Point tilSize = titleImageLabel.getSize();
        titleSize.x += tilSize.x + titleWidgetSpacing;
        if (tilSize.y > titleSize.y) titleSize.y = tilSize.y;
        selectionControls.add(titleImageLabel);
      }

      if (systemControlsBar == null && (style & SWT.CLOSE) != 0) {
        // Color closeFG = shell.getForeground(), closeBG = shell.getBackground();
        // Color closeFG = shell.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY), closeBG =
        // shell.getBackground();
        Color closeFG = shell.getDisplay().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND),
            closeBG = shell.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
        final Image closeImage = createCloseImage(shell.getDisplay(), closeBG, closeFG);
        shell.addListener(
            SWT.Dispose,
            new Listener() {
              @Override
              public void handleEvent(Event event) {
                closeImage.dispose();
              }
            });
        systemControlsBar = new ToolBar(shell, SWT.FLAT);
        systemControlsBar.setBackground(closeBG);
        systemControlsBar.setForeground(closeFG);
        ToolItem closeItem = new ToolItem(systemControlsBar, SWT.PUSH);
        closeItem.setImage(closeImage);
        closeItem.addListener(
            SWT.Selection,
            new Listener() {
              @Override
              public void handleEvent(Event event) {
                shell.close();
              }
            });
        systemControlsBar.pack();
        Point closeSize = systemControlsBar.getSize();
        titleSize.x += closeSize.x + titleWidgetSpacing;
        if (closeSize.y > titleSize.y) titleSize.y = closeSize.y;
      }

      titleSize.y += titleSpacing;
      if (titleSize.x > contentsSize.x) {
        contentsSize.x = titleSize.x;
        contents.setSize(contentsSize.x, contentsSize.y);
      }
      contentsSize.y += titleSize.y;
    }

    Rectangle screen = shell.getDisplay().getClientArea();

    int anchor = preferredAnchor;
    if (anchor != SWT.NONE && autoAnchor && locX != Integer.MIN_VALUE) {
      if ((anchor & SWT.LEFT) != 0) {
        if (locX + contentsSize.x + marginLeft + marginRight - 16 >= screen.x + screen.width)
          anchor = anchor - SWT.LEFT + SWT.RIGHT;
      } else // RIGHT
      {
        if (locX - contentsSize.x - marginLeft - marginRight + 16 < screen.x)
          anchor = anchor - SWT.RIGHT + SWT.LEFT;
      }
      if ((anchor & SWT.TOP) != 0) {
        if (locY + contentsSize.y + 20 + marginTop + marginBottom >= screen.y + screen.height)
          anchor = anchor - SWT.TOP + SWT.BOTTOM;
      } else // BOTTOM
      {
        if (locY - contentsSize.y - 20 - marginTop - marginBottom < screen.y)
          anchor = anchor - SWT.BOTTOM + SWT.TOP;
      }
    }

    final Point shellSize =
        (anchor == SWT.NONE)
            ? new Point(
                contentsSize.x + marginLeft + marginRight,
                contentsSize.y + marginTop + marginBottom)
            : new Point(
                contentsSize.x + marginLeft + marginRight,
                contentsSize.y + marginTop + marginBottom + 20);

    if (shellSize.x < 54 + marginLeft + marginRight) shellSize.x = 54 + marginLeft + marginRight;
    if (anchor == SWT.NONE) {
      if (shellSize.y < 10 + marginTop + marginBottom) shellSize.y = 10 + marginTop + marginBottom;
    } else {
      if (shellSize.y < 30 + marginTop + marginBottom) shellSize.y = 30 + marginTop + marginBottom;
    }

    shell.setSize(shellSize);
    int titleLocY = marginTop + (((anchor & SWT.TOP) != 0) ? 20 : 0);
    contents.setLocation(marginLeft, titleSize.y + titleLocY);
    if (showTitle) {
      int realTitleHeight = titleSize.y - titleSpacing;
      if (titleImageLabel != null) {
        titleImageLabel.setLocation(
            marginLeft, titleLocY + (realTitleHeight - titleImageLabel.getSize().y) / 2);
        titleLabel.setLocation(
            marginLeft + titleImageLabel.getSize().x + titleWidgetSpacing,
            titleLocY + (realTitleHeight - titleLabel.getSize().y) / 2);
      } else
        titleLabel.setLocation(
            marginLeft, titleLocY + (realTitleHeight - titleLabel.getSize().y) / 2);
      if (systemControlsBar != null)
        systemControlsBar.setLocation(
            shellSize.x - marginRight - systemControlsBar.getSize().x,
            titleLocY + (realTitleHeight - systemControlsBar.getSize().y) / 2);
    }

    final Region region = new Region();
    region.add(createOutline(shellSize, anchor, true));

    shell.setRegion(region);
    shell.addListener(
        SWT.Dispose,
        new Listener() {
          @Override
          public void handleEvent(Event event) {
            region.dispose();
          }
        });

    final int[] outline = createOutline(shellSize, anchor, false);
    shell.addListener(
        SWT.Paint,
        new Listener() {
          @Override
          public void handleEvent(Event event) {
            event.gc.drawPolygon(outline);
          }
        });

    if (locX != Integer.MIN_VALUE) {
      Point shellLoc = new Point(locX, locY);
      if ((anchor & SWT.BOTTOM) != 0) shellLoc.y = shellLoc.y - shellSize.y + 1;
      if ((anchor & SWT.LEFT) != 0) shellLoc.x -= 15;
      else if ((anchor & SWT.RIGHT) != 0) shellLoc.x = shellLoc.x - shellSize.x + 16;

      if (autoAnchor) {
        if (shellLoc.x < screen.x) shellLoc.x = screen.x;
        else if (shellLoc.x > screen.x + screen.width - shellSize.x)
          shellLoc.x = screen.x + screen.width - shellSize.x;

        if (anchor == SWT.NONE) {
          if (shellLoc.y < screen.y) shellLoc.y = screen.y;
          else if (shellLoc.y > screen.y + screen.height - shellSize.y)
            shellLoc.y = screen.y + screen.height - shellSize.y;
        }
      }

      shell.setLocation(shellLoc);
    }
  }
示例#10
0
  /**
   * Creates a new AboutDialog object. The icon displayed in this dialog box is provided by the
   * parent shell. It should be either a unique image (Shell.getImage()), or the second image of a
   * list of (Shell.getImages()[1]).
   *
   * @param parent The parent shell (also carry the icon to display).
   * @param caption Caption text.
   * @param description Text for the application description line.
   * @param version Text for the application version line.
   */
  public AboutDialog(Shell parent, String caption, String description, String version) {
    // Take the opportunity to do some clean up if possible
    Runtime rt = Runtime.getRuntime();
    rt.runFinalization();
    rt.gc();

    shell = new Shell(parent, SWT.CLOSE | SWT.TITLE | SWT.RESIZE | SWT.APPLICATION_MODAL);
    shell.setText(caption);
    UIUtil.inheritIcon(shell, parent);
    shell.setLayout(new GridLayout());

    Composite cmpTmp = new Composite(shell, SWT.BORDER);
    cmpTmp.setLayoutData(new GridData(GridData.FILL_BOTH));
    GridLayout layTmp = new GridLayout(2, false);
    cmpTmp.setLayout(layTmp);

    // Application icon
    Label appIcon = new Label(cmpTmp, SWT.NONE);
    GridData gdTmp = new GridData();
    gdTmp.verticalSpan = 2;
    appIcon.setLayoutData(gdTmp);
    Image[] list = parent.getImages();
    // Gets the single icon
    if ((list == null) || (list.length < 2)) {
      appIcon.setImage(parent.getImage());
    } else { // Or the second one if there are more than one.
      appIcon.setImage(list[1]);
    }

    Label label = new Label(cmpTmp, SWT.NONE);
    label.setText(description == null ? "TBD" : description); // $NON-NLS-1$
    gdTmp =
        new GridData(
            GridData.HORIZONTAL_ALIGN_CENTER
                | GridData.GRAB_HORIZONTAL
                | GridData.VERTICAL_ALIGN_CENTER
                | GridData.GRAB_VERTICAL);
    label.setLayoutData(gdTmp);

    label = new Label(cmpTmp, SWT.NONE);
    label.setText(
        String.format(
            Res.getString("AboutDialog.versionLabel"),
            version == null ? "TBD" : version)); // $NON-NLS-1$
    gdTmp =
        new GridData(
            GridData.HORIZONTAL_ALIGN_CENTER
                | GridData.GRAB_HORIZONTAL
                | GridData.VERTICAL_ALIGN_CENTER
                | GridData.GRAB_VERTICAL);
    label.setLayoutData(gdTmp);

    // Info

    cmpTmp = new Composite(shell, SWT.BORDER);
    cmpTmp.setLayoutData(new GridData(GridData.FILL_BOTH));
    layTmp = new GridLayout(2, false);
    cmpTmp.setLayout(layTmp);

    label = new Label(cmpTmp, SWT.NONE);
    label.setText(Res.getString("AboutDialog.jvmVersion")); // $NON-NLS-1$
    label = new Label(cmpTmp, SWT.NONE);
    label.setText(System.getProperty("java.version")); // $NON-NLS-1$
    label = new Label(cmpTmp, SWT.NONE);
    label.setText(Res.getString("AboutDialog.platform")); // $NON-NLS-1$
    label = new Label(cmpTmp, SWT.NONE);
    label.setText(
        String.format(
            "%s, %s, %s", //$NON-NLS-1$
            System.getProperty("os.name"), // $NON-NLS-1$
            System.getProperty("os.arch"), // $NON-NLS-1$
            System.getProperty("os.version"))); // $NON-NLS-1$
    label = new Label(cmpTmp, SWT.NONE);
    label.setText(Res.getString("AboutDialog.memoryLabel")); // $NON-NLS-1$
    label = new Label(cmpTmp, SWT.NONE);
    NumberFormat nf = NumberFormat.getInstance();
    label.setText(
        String.format(
            Res.getString("AboutDialog.memory"), // $NON-NLS-1$
            nf.format(rt.freeMemory() / 1024),
            nf.format(rt.totalMemory() / 1024)));

    // --- Dialog-level buttons

    SelectionAdapter CloseActions =
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            shell.close();
          };
        };
    ClosePanel pnlActions = new ClosePanel(shell, SWT.NONE, CloseActions, false);
    pnlActions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    shell.setDefaultButton(pnlActions.btClose);

    shell.pack();
    shell.setMinimumSize(shell.getSize());
    Point startSize = shell.getMinimumSize();
    if (startSize.x < 350) startSize.x = 350;
    shell.setSize(startSize);
    Dialogs.centerWindow(shell, parent);
  }
示例#11
0
文件: Editor.java 项目: asgeirf/okapi
  private void create(Shell parent, boolean readOnly) {
    shell.setText(Res.getString("EditorCaption"));
    if (parent != null) shell.setImage(parent.getImage());
    GridLayout layTmp = new GridLayout();
    layTmp.marginBottom = 0;
    layTmp.verticalSpacing = 0;
    shell.setLayout(layTmp);

    TabFolder tfTmp = new TabFolder(shell, SWT.NONE);
    GridData gdTmp = new GridData(GridData.FILL_BOTH);
    tfTmp.setLayoutData(gdTmp);

    // --- Options tab

    Composite cmpTmp = new Composite(tfTmp, SWT.NONE);
    layTmp = new GridLayout();
    cmpTmp.setLayout(layTmp);

    Group grpTmp = new Group(cmpTmp, SWT.NONE);
    layTmp = new GridLayout();
    grpTmp.setLayout(layTmp);
    grpTmp.setText(Res.getString("grpStandaloneStrings"));
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    grpTmp.setLayoutData(gdTmp);

    chkExtractStandalone = new Button(grpTmp, SWT.CHECK);
    chkExtractStandalone.setText(Res.getString("chkExtractStandalone"));

    grpTmp = new Group(cmpTmp, SWT.NONE);
    grpTmp.setLayout(new GridLayout());
    grpTmp.setText(Res.getString("grpKeyValuePairs"));
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    grpTmp.setLayoutData(gdTmp);

    rdExtractAllPairs = new Button(grpTmp, SWT.RADIO);
    rdExtractAllPairs.setText(Res.getString("rdExtractAllPairs"));
    rdDontExtractPairs = new Button(grpTmp, SWT.RADIO);
    rdDontExtractPairs.setText(Res.getString("rdDontExtractPairs"));

    Label label = new Label(grpTmp, SWT.NONE);
    label.setText(Res.getString("stExceptions"));

    edExceptions = new Text(grpTmp, SWT.BORDER);
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    edExceptions.setLayoutData(gdTmp);

    TabItem tiTmp = new TabItem(tfTmp, SWT.NONE);
    tiTmp.setText(Res.getString("tabOptions"));
    tiTmp.setControl(cmpTmp);

    // --- Inline tab

    cmpTmp = new Composite(tfTmp, SWT.NONE);
    layTmp = new GridLayout();
    cmpTmp.setLayout(layTmp);

    chkUseCodeFinder = new Button(cmpTmp, SWT.CHECK);
    chkUseCodeFinder.setText("Has inline codes as defined below:");
    chkUseCodeFinder.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            updateInlineCodes();
          };
        });

    pnlCodeFinder = new InlineCodeFinderPanel(cmpTmp, SWT.NONE);
    pnlCodeFinder.setLayoutData(new GridData(GridData.FILL_BOTH));

    tiTmp = new TabItem(tfTmp, SWT.NONE);
    tiTmp.setText("Inline Codes");
    tiTmp.setControl(cmpTmp);

    // --- Output tab

    /*cmpTmp = new Composite(tfTmp, SWT.NONE);
    layTmp = new GridLayout();
    cmpTmp.setLayout(layTmp);

    grpTmp = new Group(cmpTmp, SWT.NONE);
    layTmp = new GridLayout();
    grpTmp.setLayout(layTmp);
    grpTmp.setText(Res.getString("grpExtendedChars"));
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    grpTmp.setLayoutData(gdTmp);

    chkEscapeExtendedChars = new Button(grpTmp, SWT.CHECK);
    chkEscapeExtendedChars.setText(Res.getString("chkEscapeExtendedChars"));

    tiTmp = new TabItem(tfTmp, SWT.NONE);
    tiTmp.setText(Res.getString("tabOutput"));
    tiTmp.setControl(cmpTmp);*/

    // --- Dialog-level buttons

    SelectionAdapter OKCancelActions =
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            result = false;
            if (e.widget.getData().equals("h")) {
              if (help != null) help.showWiki("JSON Filter");
              return;
            }
            if (e.widget.getData().equals("o")) {
              if (!saveData()) return;
              result = true;
            }
            shell.close();
          };
        };
    pnlActions = new OKCancelPanel(shell, SWT.NONE, OKCancelActions, true);
    gdTmp = new GridData(GridData.FILL_HORIZONTAL);
    pnlActions.setLayoutData(gdTmp);
    pnlActions.btOK.setEnabled(!readOnly);
    if (!readOnly) {
      shell.setDefaultButton(pnlActions.btOK);
    }

    shell.pack();
    Rectangle Rect = shell.getBounds();
    shell.setMinimumSize(Rect.width, Rect.height);
    Dialogs.centerWindow(shell, parent);
    setData();
  }