Package org.rssowl.ui.internal.dialogs

Examples of org.rssowl.ui.internal.dialogs.CustomWizardDialog


   * @param isKeywordSearch defines if the keyword search should be selected or
   * not.
   */
  public void openWizard(Shell shell, final String website, boolean isKeywordSearch) {
    final ImportWizard importWizard = new ImportWizard(website, isKeywordSearch);
    CustomWizardDialog dialog = new CustomWizardDialog(shell, importWizard) {

      @Override
      protected boolean isResizable() {
        return true;
      }

      @Override
      public int open() {
        if (StringUtils.isSet(website))
          importWizard.getContainer().showPage(importWizard.getNextPage(getCurrentPage()));

        return super.open();
      }

      @Override
      protected IDialogSettings getDialogBoundsSettings() {
        IDialogSettings settings = Activator.getDefault().getDialogSettings();
        IDialogSettings section = settings.getSection(SETTINGS_SECTION);
        if (section != null)
          return section;

        return settings.addNewSection(SETTINGS_SECTION);
      }

      @Override
      protected int getDialogBoundsStrategy() {
        return DIALOG_PERSISTSIZE;
      }
    };
    dialog.setMinimumPageSize(0, 0);
    dialog.create();
    dialog.open();
  }
View Full Code Here


   * @param needsProgressPart <code>true</code> to leave some room for the
   * {@link ProgressMonitorPart} and <code>false</code> otherwise.
   * @param dialogSettingsKey the key to use to store dialog settings.
   */
  public static void openWizard(Shell shell, Wizard wizard, final boolean modal, final boolean needsProgressPart, final String dialogSettingsKey) {
    CustomWizardDialog dialog = new CustomWizardDialog(shell, wizard) {
      private ProgressMonitorPart progressMonitorPart;

      @Override
      protected boolean isResizable() {
        return true;
      }

      @Override
      protected Control createDialogArea(Composite parent) {
        Control control = super.createDialogArea(parent);
        if (progressMonitorPart != null && !needsProgressPart)
          ((GridData) progressMonitorPart.getLayoutData()).exclude = true;
        return control;
      }

      @Override
      public boolean close() {
        progressMonitorPart = null;
        return super.close();
      }

      @Override
      protected ProgressMonitorPart createProgressMonitorPart(Composite composite, GridLayout pmlayout) {
        progressMonitorPart = super.createProgressMonitorPart(composite, pmlayout);
        return progressMonitorPart;
      }

      @Override
      protected IDialogSettings getDialogBoundsSettings() {
        if (dialogSettingsKey != null) {
          IDialogSettings settings = Activator.getDefault().getDialogSettings();
          IDialogSettings section = settings.getSection(dialogSettingsKey);
          if (section != null)
            return section;

          return settings.addNewSection(dialogSettingsKey);
        }

        return super.getDialogBoundsSettings();
      }

      @Override
      protected int getShellStyle() {
        if (modal)
          return super.getShellStyle();

        return SWT.TITLE | SWT.BORDER | SWT.MIN | SWT.RESIZE | SWT.CLOSE | getDefaultOrientation();
      }

      @Override
      protected int getDialogBoundsStrategy() {
        return DIALOG_PERSISTSIZE;
      }
    };
    dialog.setMinimumPageSize(0, 0);
    dialog.create();
    dialog.open();
  }
View Full Code Here

   * and <code>false</code> otherwise.
   * @param finishLabel the label for the finish button or <code>null</code> to
   * use the default.
   */
  public static void openWizard(Shell shell, Wizard wizard, final boolean modal, final boolean needsProgressPart, final String dialogSettingsKey, final boolean pack, final String finishLabel) {
    CustomWizardDialog dialog = new CustomWizardDialog(shell, wizard) {
      private ProgressMonitorPart progressMonitorPart;

      @Override
      protected boolean isResizable() {
        return true;
      }

      @Override
      protected Control createDialogArea(Composite parent) {
        Control control = super.createDialogArea(parent);
        if (progressMonitorPart != null && !needsProgressPart)
          ((GridData) progressMonitorPart.getLayoutData()).exclude = true;
        return control;
      }

      @Override
      public boolean close() {
        progressMonitorPart = null;
        return super.close();
      }

      @Override
      protected ProgressMonitorPart createProgressMonitorPart(Composite composite, GridLayout pmlayout) {
        progressMonitorPart = super.createProgressMonitorPart(composite, pmlayout);
        return progressMonitorPart;
      }

      @Override
      protected IDialogSettings getDialogBoundsSettings() {
        if (dialogSettingsKey != null) {
          IDialogSettings settings = Activator.getDefault().getDialogSettings();
          IDialogSettings section = settings.getSection(dialogSettingsKey);
          if (section != null)
            return section;

          return settings.addNewSection(dialogSettingsKey);
        }

        return super.getDialogBoundsSettings();
      }

      @Override
      protected int getShellStyle() {
        if (modal)
          return super.getShellStyle();

        return SWT.TITLE | SWT.BORDER | SWT.MIN | SWT.RESIZE | SWT.CLOSE | getDefaultOrientation();
      }

      @Override
      protected int getDialogBoundsStrategy() {
        return DIALOG_PERSISTSIZE;
      }

      @Override
      protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
        if (IDialogConstants.FINISH_ID == id && StringUtils.isSet(finishLabel))
          label = finishLabel;

        return super.createButton(parent, id, label, defaultButton);
      }

      @Override
      protected Point getInitialSize() {
        if (pack) {
          int width = Application.IS_WINDOWS ? WINDOWS_PACKED_WIZARD_WIDTH : Application.IS_LINUX ? LINUX_PACKED_WIZARD_WIDTH : MAC_PACKED_WIZARD_WIDTH;
          return getShell().computeSize(convertHorizontalDLUsToPixels(width), SWT.DEFAULT, true);
        }

        return super.getInitialSize();
      }
    };
    dialog.setMinimumPageSize(0, 0);
    dialog.create();
    dialog.open();
  }
View Full Code Here

    internalOpenWizard(shell, targetFolder, file, false, false);
  }

  private void internalOpenWizard(Shell shell, IFolder targetFolder, final String fileOrWebsite, boolean isKeywordSearch, final boolean isWebsiteSearch) {
    final ImportWizard importWizard = new ImportWizard(targetFolder, fileOrWebsite, isKeywordSearch);
    CustomWizardDialog dialog = new CustomWizardDialog(shell, importWizard) {

      @Override
      protected boolean isResizable() {
        return true;
      }

      @Override
      public int open() {
        if (StringUtils.isSet(fileOrWebsite) && isWebsiteSearch)
          importWizard.getContainer().showPage(importWizard.getNextPage(getCurrentPage()));

        return super.open();
      }

      @Override
      protected IDialogSettings getDialogBoundsSettings() {
        IDialogSettings settings = Activator.getDefault().getDialogSettings();
        IDialogSettings section = settings.getSection(SETTINGS_SECTION);
        if (section != null)
          return section;

        return settings.addNewSection(SETTINGS_SECTION);
      }

      @Override
      protected int getDialogBoundsStrategy() {
        return DIALOG_PERSISTSIZE;
      }
    };
    dialog.setMinimumPageSize(0, 0);
    dialog.create();
    dialog.open();
  }
View Full Code Here

TOP

Related Classes of org.rssowl.ui.internal.dialogs.CustomWizardDialog

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.