Exemplo n.º 1
0
  /** Stores it current configuration in the dialog store. */
  private void writeConfiguration() {
    IDialogSettings s = getDialogSettings();
    s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive);
    s.put(STORE_IS_REG_EX_SEARCH, fIsRegExSearch);
    s.put(STORE_SEARCH_DERIVED, fSearchDerived);

    int historySize = Math.min(fPreviousSearchPatterns.size(), HISTORY_SIZE);
    s.put(STORE_HISTORY_SIZE, historySize);
    for (int i = 0; i < historySize; i++) {
      IDialogSettings histSettings = s.addNewSection(STORE_HISTORY + i);
      SearchPatternData data = fPreviousSearchPatterns.get(i);
      data.store(histSettings);
    }

    IDialogSettings extensionsSettings = s.addNewSection(STORE_EXTENSIONS);
    extensionsSettings.put(Integer.toString(0), fExtensions.getText());
    Set<String> extensions = new HashSet<String>(HISTORY_SIZE);
    extensions.add(fExtensions.getText());
    int length = Math.min(fExtensions.getItemCount(), HISTORY_SIZE - 1);
    int j = 1;
    for (int i = 0; i < length; i++) {
      String extension = fExtensions.getItem(i);
      if (extensions.add(extension)) {
        extensionsSettings.put(Integer.toString(j++), extension);
      }
    }
  }
Exemplo n.º 2
0
 /**
  * Finds or creates a dialog settings section that is used to make the dialog control settings
  * persistent
  */
 public IDialogSettings getSettingsSection(IDialogSettings master) {
   IDialogSettings settings = master.getSection(SETTINGS_SECTION);
   if (settings == null) {
     settings = master.addNewSection(SETTINGS_SECTION);
   }
   return settings;
 }
Exemplo n.º 3
0
  private void saveDialogSettings() {
    IDialogSettings settings;
    IDialogSettings section;

    settings = SystemBrowserPlugin.getDefault().getDialogSettings();
    section = settings.addNewSection("PoolFilterDialog");

    section.put("target", targetCombo.getText());
    section.put("poolId", poolIdText.getText().trim());
    section.put("tab", tabFolder.getSelectionIndex());

    section.put("signalNumberFrom", signalNumberFromText.getText().trim());
    section.put("signalNumberTo", signalNumberToText.getText().trim());
    section.put("signalOwnerId", signalOwnerIdText.getText().trim());
    section.put("signalOwnerName", signalOwnerNameText.getText().trim());
    section.put("signalSenderId", signalSenderIdText.getText().trim());
    section.put("signalSenderName", signalSenderNameText.getText().trim());
    section.put("signalAddresseeId", signalAddresseeIdText.getText().trim());
    section.put("signalAddresseeName", signalAddresseeNameText.getText().trim());
    section.put("signalSizeFrom", signalSizeFromText.getText().trim());
    section.put("signalSizeTo", signalSizeToText.getText().trim());
    section.put("signalBufferSizeFrom", signalBufferSizeFromText.getText().trim());
    section.put("signalBufferSizeTo", signalBufferSizeToText.getText().trim());
    section.put("signalAddressFrom", signalAddressFromText.getText().trim());
    section.put("signalAddressTo", signalAddressToText.getText().trim());
    section.put("signalStatus", signalStatusCombo.getText());

    section.put("signalNumberExclude", signalNumberCheckbox.getSelection());
    section.put("signalOwnerIdExclude", signalOwnerIdCheckbox.getSelection());
    section.put("signalOwnerNameExclude", signalOwnerNameCheckbox.getSelection());
    section.put("signalSenderIdExclude", signalSenderIdCheckbox.getSelection());
    section.put("signalSenderNameExclude", signalSenderNameCheckbox.getSelection());
    section.put("signalAddresseeIdExclude", signalAddresseeIdCheckbox.getSelection());
    section.put("signalAddresseeNameExclude", signalAddresseeNameCheckbox.getSelection());
    section.put("signalSizeExclude", signalSizeCheckbox.getSelection());
    section.put("signalBufferSizeExclude", signalBufferSizeCheckbox.getSelection());
    section.put("signalAddressExclude", signalAddressCheckbox.getSelection());
    section.put("signalStatusExclude", signalStatusCheckbox.getSelection());

    section.put("stackOwnerId", stackOwnerIdText.getText().trim());
    section.put("stackOwnerName", stackOwnerNameText.getText().trim());
    section.put("stackSizeFrom", stackSizeFromText.getText().trim());
    section.put("stackSizeTo", stackSizeToText.getText().trim());
    section.put("stackBufferSizeFrom", stackBufferSizeFromText.getText().trim());
    section.put("stackBufferSizeTo", stackBufferSizeToText.getText().trim());
    section.put("stackAddressFrom", stackAddressFromText.getText().trim());
    section.put("stackAddressTo", stackAddressToText.getText().trim());
    section.put("stackUsedFrom", stackUsedFromText.getText().trim());
    section.put("stackUsedTo", stackUsedToText.getText().trim());
    section.put("stackUnusedFrom", stackUnusedFromText.getText().trim());
    section.put("stackUnusedTo", stackUnusedToText.getText().trim());

    section.put("stackOwnerIdExclude", stackOwnerIdCheckbox.getSelection());
    section.put("stackOwnerNameExclude", stackOwnerNameCheckbox.getSelection());
    section.put("stackSizeExclude", stackSizeCheckbox.getSelection());
    section.put("stackBufferSizeExclude", stackBufferSizeCheckbox.getSelection());
    section.put("stackAddressExclude", stackAddressCheckbox.getSelection());
    section.put("stackUsedExclude", stackUsedCheckbox.getSelection());
    section.put("stackUnusedExclude", stackUnusedCheckbox.getSelection());
  }
Exemplo n.º 4
0
 @Override
 protected IDialogSettings getDialogBoundsSettings() {
   IDialogSettings settings = Activator.getDefault().getDialogSettings();
   IDialogSettings section = settings.getSection(DIALOG_SETTINGS_SECTION_NAME);
   if (section == null) section = settings.addNewSection(DIALOG_SETTINGS_SECTION_NAME);
   return section;
 }
  /**
   * Saves the state of the filter into the given dialog settings.
   *
   * @param dialogSettings the dialog settings
   */
  public void saveState(final IDialogSettings dialogSettings) {

    if (dialogSettings != null) {
      IDialogSettings settings = dialogSettings.getSection(TAG_DIALOG_SECTION);

      if (settings == null) {
        settings = dialogSettings.addNewSection(TAG_DIALOG_SECTION);
      }

      settings.put(TAG_ENABLED, this.mEnabled);
      settings.put(TAG_ON_RESOURCE, this.mOnResource);

      if (this.mWorkingSet != null) {
        settings.put(TAG_WORKING_SET, this.mWorkingSet.getName());
      }

      settings.put(TAG_SELECT_BY_SEVERITY, this.mSelectBySeverity);
      settings.put(TAG_SEVERITY, this.mSeverity);

      settings.put(TAG_SELECT_BY_REGEX, this.mFilterByRegex);

      if (this.mFilterRegex != null) {
        settings.put(
            TAG_REGULAR_EXPRESSIONS,
            (String[]) this.mFilterRegex.toArray(new String[this.mFilterRegex.size()]));
      }
    }
  }
Exemplo n.º 6
0
 /**
  * Returns a section in the Erlang plugin's dialog settings. If the section doesn't exist yet, it
  * is created.
  *
  * @param name the name of the section
  * @return the section of the given name
  * @since 3.2
  */
 public IDialogSettings getDialogSettingsSection(final String name) {
   final IDialogSettings dialogSettings = getDialogSettings();
   IDialogSettings section = dialogSettings.getSection(name);
   if (section == null) {
     section = dialogSettings.addNewSection(name);
   }
   return section;
 }
Exemplo n.º 7
0
 /* (non-Javadoc)
  * @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
  */
 protected IDialogSettings getDialogBoundsSettings() {
   IDialogSettings settings = JavaPlugin.getDefault().getDialogSettings();
   IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
   if (section == null) {
     section = settings.addNewSection(getDialogSettingsSectionName());
   }
   return section;
 }
 /**
  * Returns the dialog settings for this hover or <code>null</code> if none
  *
  * @param create whether to create the settings
  */
 private IDialogSettings getDialogSettings(boolean create) {
   IDialogSettings settings = Activator.getDefault().getDialogSettings();
   IDialogSettings section = settings.getSection(this.getClass().getName());
   if (section == null & create) {
     section = settings.addNewSection(this.getClass().getName());
   }
   return section;
 }
Exemplo n.º 9
0
 /**
  * Returns the {@link IDialogSettings} for the given id
  *
  * @param id the id of the dialog settings to get
  * @return the {@link IDialogSettings} to pass into the {@link ContainerSelectionDialog}
  * @since 3.6
  */
 IDialogSettings getDialogBoundsSettings(String id) {
   IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = settings.getSection(id);
   if (section == null) {
     section = settings.addNewSection(id);
   }
   return section;
 }
Exemplo n.º 10
0
 /* (non-Javadoc)
  * @see org.eclipse.jface.window.Dialog#getDialogBoundsSettings()
  *
  * @since 3.2
  */
 protected IDialogSettings getDialogBoundsSettings() {
   IDialogSettings settings = IDEWorkbenchPlugin.getDefault().getDialogSettings();
   IDialogSettings section = settings.getSection(DIALOG_SETTINGS_SECTION);
   if (section == null) {
     section = settings.addNewSection(DIALOG_SETTINGS_SECTION);
   }
   return section;
 }
Exemplo n.º 11
0
 /* (non-Javadoc)
  * @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings()
  */
 protected IDialogSettings getDialogBoundsSettings() {
   IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = settings.getSection(SETTINGS_ID);
   if (section == null) {
     section = settings.addNewSection(SETTINGS_ID);
   }
   return section;
 }
Exemplo n.º 12
0
 public static IDialogSettings getDialogSettings(String dialogId) {
   IDialogSettings workbenchSettings = DBeaverActivator.getInstance().getDialogSettings();
   IDialogSettings section = workbenchSettings.getSection(dialogId);
   if (section == null) {
     section = workbenchSettings.addNewSection(dialogId);
   }
   return section;
 }
 private void initDialogSettings() {
   IDialogSettings workbenchSettings = SamplesUIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = workbenchSettings.getSection(NEWPROJECT_WIZARD);
   if (section == null) {
     section = workbenchSettings.addNewSection(NEWPROJECT_WIZARD);
   }
   setDialogSettings(section);
 }
 /** Constructs the import trace package wizard */
 public ImportTracePackageWizard() {
   IDialogSettings workbenchSettings = Activator.getDefault().getDialogSettings();
   IDialogSettings section = workbenchSettings.getSection(STORE_IMPORT_TRACE_PKG_WIZARD);
   if (section == null) {
     section = workbenchSettings.addNewSection(STORE_IMPORT_TRACE_PKG_WIZARD);
   }
   setDialogSettings(section);
 }
Exemplo n.º 15
0
 /**
  * Gets the dialog settings.
  *
  * @param sectionName The sectionName
  * @return The dialog settings
  */
 public IDialogSettings getDialogSettings(String sectionName) {
   IDialogSettings settings = getDialogSettings();
   IDialogSettings section = settings.getSection(sectionName);
   if (section == null) {
     section = settings.addNewSection(sectionName);
   }
   return section;
 }
 public QifBankDownloadImportWizard() {
   IDialogSettings workbenchSettings = QIFPlugin.getDefault().getDialogSettings();
   IDialogSettings section = workbenchSettings.getSection("QifImportWizard"); // $NON-NLS-1$
   if (section == null) {
     section = workbenchSettings.addNewSection("QifImportWizard"); // $NON-NLS-1$
   }
   setDialogSettings(section);
 }
Exemplo n.º 17
0
 /** Saves the state of the widgets on the page */
 void saveWidgetState() {
   IDialogSettings rootsettings = ApiUIPlugin.getDefault().getDialogSettings();
   IDialogSettings settings = rootsettings.getSection(SETTINGS_SECTION);
   if (settings == null) {
     settings = rootsettings.addNewSection(SETTINGS_SECTION);
   }
   settings.put(REPORT_PATH_STATE, getValue());
 }
 @Override
 protected IDialogSettings getDialogSettings() {
   IDialogSettings settings = CeylonPlugin.getInstance().getDialogSettings();
   IDialogSettings section = settings.getSection(SETTINGS_ID);
   if (section == null) {
     section = settings.addNewSection(SETTINGS_ID);
   }
   return section;
 }
Exemplo n.º 19
0
 @Override
 protected IDialogSettings getDialogBoundsSettings() {
   final IDialogSettings root = Q7UIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = root.getSection(SETTINGS_KEY);
   if (section == null) {
     section = root.addNewSection(SETTINGS_KEY);
   }
   return section;
 }
Exemplo n.º 20
0
 /**
  * Returns the dialog settings object used to save state for this dialog.
  *
  * @return the dialog settings to be used
  */
 protected IDialogSettings getDialogSettings() {
   IDialogSettings allSettings = CUIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = allSettings.getSection(fDialogSection);
   if (section == null) {
     section = allSettings.addNewSection(fDialogSection);
     writeDefaultSettings(section);
   }
   return section;
 }
Exemplo n.º 21
0
 public ErlangProjectImportWizard() {
   super();
   final IDialogSettings workbenchSettings = ErlideUIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = workbenchSettings.getSection("FileSystemImportWizard"); // $NON-NLS-1$
   if (section == null) {
     section = workbenchSettings.addNewSection("FileSystemImportWizard"); // $NON-NLS-1$
   }
   setDialogSettings(section);
 }
Exemplo n.º 22
0
 /**
  * Initialize the wizard's dialog-settings.<br>
  * Subclasses should override to provide specific initialization.
  */
 protected void initDialogSettings() {
   IDialogSettings workbenchSettings = ProjectsPlugin.getDefault().getDialogSettings();
   IDialogSettings section =
       workbenchSettings.getSection("BasicNewProjectResourceWizard"); // $NON-NLS-1$
   if (section == null) {
     section = workbenchSettings.addNewSection("BasicNewProjectResourceWizard"); // $NON-NLS-1$
   }
   setDialogSettings(section);
 }
Exemplo n.º 23
0
 /**
  * Returns the existing dialog settings for the persisted state of the caught and uncaught check
  * boxes. If no section exists then a new one is created
  *
  * @return the dialog settings section for the type dialog extension
  * @since 3.4
  */
 private IDialogSettings getDialogSettings() {
   IDialogSettings allSetttings = DLTKDebugUIPlugin.getDefault().getDialogSettings();
   IDialogSettings section = allSetttings.getSection(DIALOG_SETTINGS);
   if (section == null) {
     section = allSetttings.addNewSection(DIALOG_SETTINGS);
     section.put(CAUGHT_CHECKED, true);
     section.put(UNCAUGHT_CHECKED, true);
   }
   return section;
 }
Exemplo n.º 24
0
 private static IDialogSettings getSection(String sectionName) {
   //
   TeacherPlugin plugin = TeacherPlugin.getDefault();
   IDialogSettings ds = plugin.getDialogSettings();
   IDialogSettings section = ds.getSection(sectionName);
   if (section == null) {
     section = ds.addNewSection(sectionName);
   }
   return section;
 }
Exemplo n.º 25
0
  /* (non-Javadoc)
   * @see org.eclipse.ui.part.ViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
   */
  @Override
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site, memento);

    BundleContext bundleContext = UIActivator.getDefault().getBundle().getBundleContext();

    ServiceReference<ITradingSystemService> serviceReference =
        bundleContext.getServiceReference(ITradingSystemService.class);
    tradingSystemService = bundleContext.getService(serviceReference);

    activator = CoreActivator.getDefault();

    IDialogSettings rootDialogSettings = UIActivator.getDefault().getDialogSettings();
    dialogSettings = rootDialogSettings.getSection(VIEW_ID);
    if (dialogSettings == null) {
      dialogSettings = rootDialogSettings.addNewSection(VIEW_ID);
      dialogSettings.put(
          COLUMNS,
          new String[] {
            "org.eclipsetrader.ui.providers.LastTrade", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.BidPrice", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.AskPrice", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.Position", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.LastTradeDateTime", //$NON-NLS-1$
            "org.eclipsetrader.ui.providers.gain", //$NON-NLS-1$
          });
      IDialogSettings section = dialogSettings.addNewSection(COLUMN_NAMES);
      section.put("org.eclipsetrader.ui.providers.LastTrade", "Last"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.BidPrice", "Bid"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.AskPrice", "Ask"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.Position", "Position"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.LastTradeDateTime", "Date / Time"); // $NON-NLS-1$
      section.put("org.eclipsetrader.ui.providers.gain", "Gain"); // $NON-NLS-1$
      dialogSettings.addNewSection(COLUMN_WIDTHS);
    }

    settingsAction = new SettingsAction(site.getShell(), this);

    IActionBars actionBars = site.getActionBars();
    actionBars.setGlobalActionHandler(settingsAction.getId(), settingsAction);
    actionBars.updateActionBars();
  }
Exemplo n.º 26
0
 public ExportBarWizard() {
   setDefaultPageImageDescriptor(Pics.getWizban());
   setNeedsProgressMonitor(true);
   IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
   IDialogSettings wizardSettings = workbenchSettings.getSection("ExportBarWizard"); // $NON-NLS-1$
   if (wizardSettings == null) {
     wizardSettings = workbenchSettings.addNewSection("ExportBarWizard"); // $NON-NLS-1$
   }
   setDialogSettings(wizardSettings);
   setWindowTitle(Messages.buildTitle);
 }
Exemplo n.º 27
0
  /** Stores the current configuration in the dialog store. */
  private void writeConfiguration() {
    final IDialogSettings s = getDialogSettings();

    final int historySize = Math.min(fPreviousSearchPatterns.size(), HISTORY_SIZE);
    s.put(STORE_HISTORY_SIZE, historySize);
    for (int i = 0; i < historySize; i++) {
      final IDialogSettings histSettings = s.addNewSection(STORE_HISTORY + i);
      final SearchPatternData data = fPreviousSearchPatterns.get(i);
      data.store(histSettings);
    }
  }
 @Override
 public boolean performFinish() {
   if (fNewSettings) {
     final IDialogSettings settings = RefactoringUIPlugin.getDefault().getDialogSettings();
     IDialogSettings section = settings.getSection(DIALOG_SETTINGS_KEY);
     section = settings.addNewSection(DIALOG_SETTINGS_KEY);
     setDialogSettings(section);
   }
   fWizardPage.performFinish();
   return true;
 }
Exemplo n.º 29
0
 /**
  * Runs the wizard in a dialog.
  *
  * @generated
  */
 public static void runWizard(Shell shell, Wizard wizard, String settingsKey) {
   IDialogSettings pluginDialogSettings = UMLDiagramEditorPlugin.getInstance().getDialogSettings();
   IDialogSettings wizardDialogSettings = pluginDialogSettings.getSection(settingsKey);
   if (wizardDialogSettings == null) {
     wizardDialogSettings = pluginDialogSettings.addNewSection(settingsKey);
   }
   wizard.setDialogSettings(wizardDialogSettings);
   WizardDialog dialog = new WizardDialog(shell, wizard);
   dialog.create();
   dialog.getShell().setSize(Math.max(500, dialog.getShell().getSize().x), 500);
   dialog.open();
 }
Exemplo n.º 30
0
  @Override
  protected IDialogSettings getDialogBoundsSettings() {
    final String settingsName = getClass().getCanonicalName();

    IDialogSettings workbenchSettings = WorkbenchPlugin.getDefault().getDialogSettings();
    IDialogSettings section = workbenchSettings.getSection(settingsName);

    if (section == null) {
      section = workbenchSettings.addNewSection(settingsName);
    }

    return section;
  }