Java Code Examples for org.eclipse.jface.dialogs.IDialogSettings#getBoolean()

The following examples show how to use org.eclipse.jface.dialogs.IDialogSettings#getBoolean() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PopupDialog.java    From SWET with MIT License 6 votes vote down vote up
private void migrateBoundsSetting() {
	IDialogSettings settings = getDialogSettings();
	if (settings == null)
		return;

	final String className = getClass().getName();

	String key = className + DIALOG_USE_PERSISTED_BOUNDS;
	String value = settings.get(key);
	if (value == null || DIALOG_VALUE_MIGRATED_TO_34.equals(value))
		return;

	boolean storeBounds = settings.getBoolean(key);
	settings.put(className + DIALOG_USE_PERSISTED_LOCATION, storeBounds);
	settings.put(className + DIALOG_USE_PERSISTED_SIZE, storeBounds);
	settings.put(key, DIALOG_VALUE_MIGRATED_TO_34);
}
 
Example 2
Source File: Convert2TmxDialog.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
private void loadDialogSettings() {
	IDialogSettings dialogSettings = getDialogSettings();
	isOpenBtn.setSelection(dialogSettings.getBoolean("isOpen"));
	boolean isCustomSlect = dialogSettings.getBoolean("isCustom");
	if (!isCustomSlect) {
		return;
	}
	addCustomAttributeBtn.setSelection(isCustomSlect);
	String[] array = dialogSettings.getArray("CustomValues");
	if (null == array || array.length == 0) {
		if (isCustomSlect) {
			createArributeArea(attributeArea, null, null);
		}
		return;
	}
	for (String key_value : array) {
		String[] split = key_value.split(ID_MARK);
		createArributeArea(attributeArea, split[0], split[1]);
	}
}
 
Example 3
Source File: SelectArtifactToDeployPage.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void loadSettings(IDialogSettings settings) {
    IDialogSettings section = settings.getSection(repositoryModel.getName());
    if (section != null && section.getArray(DEPLOY_DEFAULT_SELECTION) != null) {
        if (defaultSelectedElements == null || defaultSelectedElements.isEmpty()) {
            defaultSelectedElements = fromStrings(section.getArray(DEPLOY_DEFAULT_SELECTION));
        }
        cleanBDM = section.getBoolean(CLEAN_BDM_DEFAULT_SELECTION);
        validate = section.getBoolean(VALIDATE_DEFAULT_SELECTION);
        latestVersionOnly = section.getBoolean(ONLY_LATEST_PROCESS_VERSION_SELECTION);
    }
    String activeEnvironment = ConfigurationPlugin.getDefault().getPreferenceStore()
            .getString(ConfigurationPreferenceConstants.DEFAULT_CONFIGURATION);
    environment = environmentProvider.getEnvironment().contains(activeEnvironment) ? activeEnvironment
            : ConfigurationPreferenceConstants.LOCAL_CONFIGURAITON;
}
 
Example 4
Source File: EclipseFindSettings.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Initializes itself from the dialog settings with the same state as at the previous invocation.
 */
/* default */void readConfiguration()
{
	IDialogSettings s = getDialogSettings();

	fWrap = s.get("wrap") == null || s.getBoolean("wrap"); //$NON-NLS-1$ //$NON-NLS-2$
	fCase = s.getBoolean("casesensitive"); //$NON-NLS-1$
	fWholeWord = s.getBoolean("wholeword"); //$NON-NLS-1$
	fRegExSearch = s.getBoolean("isRegEx"); //$NON-NLS-1$
	fSelection = s.get("selection"); //$NON-NLS-1$

	String[] findHistory = s.getArray("findhistory"); //$NON-NLS-1$
	if (findHistory != null)
	{
		fFindHistory.clear();
		for (int i = 0; i < findHistory.length; i++)
		{
			fFindHistory.add(findHistory[i]);
		}
	}
}
 
Example 5
Source File: ImportProjectWizardPage.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use the dialog store to restore widget values to the values that they
 * held last time this wizard was used to completion, or alternatively,
 * if an initial path is specified, use it to select values.
 * 
 * Method declared public only for use of tests.
 */
public void restoreWidgetValues() {
			
	// First, check to see if we have resore settings, and
	// take care of the checkbox
	IDialogSettings settings = getDialogSettings();
	if (settings != null) {
		// checkbox
		copyFiles = settings.getBoolean(STORE_COPY_PROJECT_ID);
		lastCopyFiles = copyFiles;
	}
			
	// Third, if we do have an initial path, set the proper
	// path and radio buttons to the initial value. Move
	// cursor to the end of the path so user can see the
	// most relevant part (directory / archive name)
	else if (initialPath != null) {
		boolean dir = new File(initialPath).isDirectory();
		if (!dir) {
			archivePathField.setText(initialPath);
			archivePathField.setSelection(initialPath.length());
		}
	}
}
 
Example 6
Source File: TimeGraphFindDialog.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Initializes itself from the dialog settings with the same state as at the
 * previous invocation.
 */
private void readConfiguration() {
    IDialogSettings s = getDialogSettings();

    fWrapInit = s.get(WRAP) == null || s.getBoolean(WRAP);
    fCaseInit = s.getBoolean(CASE_SENSITIVE);
    fWholeWordInit = s.getBoolean(WHOLE_WORD);
    fIsRegExInit = s.getBoolean(IS_REGEX_EXPRESSION);

    String[] findHistory = s.getArray(FIND_HISTORY);
    if (findHistory != null) {
        fFindHistory.clear();
        for (int i = 0; i < findHistory.length; i++) {
            fFindHistory.add(findHistory[i]);
        }
    }
}
 
Example 7
Source File: AbstractNewSarlElementWizardPage.java    From sarl with Apache License 2.0 6 votes vote down vote up
/** Read the settings of the dialog box.
 */
protected void readSettings() {
	boolean createConstructors = false;
	boolean createUnimplemented = true;
	boolean createEventHandlers = true;
	boolean createLifecycleFunctions = true;
	final IDialogSettings dialogSettings = getDialogSettings();
	if (dialogSettings != null) {
		final IDialogSettings section = dialogSettings.getSection(getName());
		if (section != null) {
			createConstructors = section.getBoolean(SETTINGS_CREATECONSTR);
			createUnimplemented = section.getBoolean(SETTINGS_CREATEUNIMPLEMENTED);
			createEventHandlers = section.getBoolean(SETTINGS_GENERATEEVENTHANDLERS);
			createLifecycleFunctions = section.getBoolean(SETTINGS_GENERATELIFECYCLEFUNCTIONS);
		}
	}
	setMethodStubSelection(createConstructors, createUnimplemented, createEventHandlers,
			createLifecycleFunctions, true);
}
 
Example 8
Source File: ToolbarActionButton.java    From xds-ide with Eclipse Public License 1.0 6 votes vote down vote up
public ToolbarActionButton(String tooltip, String id, boolean isCheckBox, String imgId, boolean defaultChecked,
                         IDialogSettings settings, IClosure<Boolean> action) 
{
    super(tooltip, isCheckBox ? AS_CHECK_BOX : AS_PUSH_BUTTON);
    this.id = id;
    this.action = action;
    this.isCheckBox = isCheckBox;
    this.settings = settings;
    setId(id);
    setImageDescriptor(ImageDescriptor.createFromImage(ImageUtils.getImage(imgId)));

    if (isCheckBox) {
        boolean turnOn = defaultChecked;
        if (settings != null) {
            turnOn = settings.getBoolean(getClass().getName() + id); 
        }
        super.setChecked(turnOn);
    }
}
 
Example 9
Source File: ImportProjectWizardPage.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Use the dialog store to restore widget values to the values that they
 * held last time this wizard was used to completion, or alternatively,
 * if an initial path is specified, use it to select values.
 * 
 * Method declared public only for use of tests.
 */
public void restoreWidgetValues() {
			
	// First, check to see if we have resore settings, and
	// take care of the checkbox
	IDialogSettings settings = getDialogSettings();
	if (settings != null) {
		// checkbox
		copyFiles = settings.getBoolean(STORE_COPY_PROJECT_ID);
		lastCopyFiles = copyFiles;
	}
			
	// Third, if we do have an initial path, set the proper
	// path and radio buttons to the initial value. Move
	// cursor to the end of the path so user can see the
	// most relevant part (directory / archive name)
	else if (initialPath != null) {
		boolean dir = new File(initialPath).isDirectory();
		if (!dir) {
			archivePathField.setText(initialPath);
			archivePathField.setSelection(initialPath.length());
		}
	}
}
 
Example 10
Source File: TraceExplorerDataProvider.java    From tlaplus with MIT License 5 votes vote down vote up
/**
   * Creates an error without any replacement of text from the error message reported by TLC.
   * 
   * This overrides the method in TLCModelLaunchDataProvider because that method does a lot
   * of work to search for Strings such as inv_2354234343434 in the error message and replace
   * them with the actual invariant from the MC.tla file. The user should never see anything from
   * the TE file, so this work is unnecessary for the trace explorer.
   * 
   * <br>This is a factory method
   * 
   * @param tlcRegion a region marking the error information in the document
   * @param message the message represented by the region
   * @return the TLC Error representing the error
   */
  protected TLCError createError(TLCRegion tlcRegion, String message)
  {
      // the root of the error trace
final IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings();
      final boolean stateSortOrder = dialogSettings.getBoolean(STATESORTORDER);
final TLCError topError = new TLCError(Order.valueOf(stateSortOrder));

      if (tlcRegion instanceof TLCRegionContainer)
      {
          TLCRegionContainer container = (TLCRegionContainer) tlcRegion;
          // read out the subordinated regions
          ITypedRegion[] regions = container.getSubRegions();

          // currently, there can be at most three regions
          Assert.isTrue(regions.length < 3, "Unexpected error region structure, this is a bug.");

          // iterate over regions
          for (int i = 0; i < regions.length; i++)
          {
              // the region itself is a TLC region, detect the child error
              if (regions[i] instanceof TLCRegion)
              {
                  TLCError cause = createError((TLCRegion) regions[i], message);
                  topError.setCause(cause);
              } else
              {
                  // set error text
                  topError.setMessage(message);
                  // set error code
                  topError.setErrorCode(tlcRegion.getMessageCode());
              }
          }
      }
      return topError;

  }
 
Example 11
Source File: SelectModulaSourceFileDialog.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
@Override   
protected void restoreDialog(IDialogSettings settings) {
    super.restoreDialog(settings);

    boolean b = !forceToShowAllItems;

    if (!forceToShowAllItems && settings.get(SHOW_COMPILATOPN_SET_ONLY) != null) {
        b = settings.getBoolean(SHOW_COMPILATOPN_SET_ONLY);
    }

    toggleCompilationSetOnlyAction.setChecked(b);
}
 
Example 12
Source File: FindReplaceDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
private void readDialogSettings() {
	IDialogSettings ids = getDialogSettings();
	boolean blnDirection = ids.getBoolean("nattable.FindReplaceDialog.direction");
	forwardButton.setSelection(!blnDirection);
	backwardButton.setSelection(blnDirection);
	boolean blnRange = ids.getBoolean("nattable.FindReplaceDialog.range");
	sourceButton.setSelection(!blnRange);
	targetButton.setSelection(blnRange);

	caseSensitiveButton.setSelection(ids.getBoolean("nattable.FindReplaceDialog.caseSensitive"));
	wholeWordButton.setSelection(ids.getBoolean("nattable.FindReplaceDialog.wholeWord"));
	regExButton.setSelection(ids.getBoolean("nattable.FindReplaceDialog.regEx"));

	String[] arrFindHistory = ids.getArray("nattable.FindReplaceDialog.findHistory");
	if (arrFindHistory != null) {
		lstFindHistory.clear();
		for (int i = 0; i < arrFindHistory.length; i++) {
			lstFindHistory.add(arrFindHistory[i]);
		}
	}

	String[] arrReplaceHistory = ids.getArray("nattable.FindReplaceDialog.replaceHistory");
	if (arrReplaceHistory != null) {
		lstReplaceHistory.clear();
		for (int i = 0; i < arrReplaceHistory.length; i++) {
			lstReplaceHistory.add(arrReplaceHistory[i]);
		}
	}
}
 
Example 13
Source File: EqualsHashCodeDialogStrategyHelper.java    From jenerate with Eclipse Public License 1.0 5 votes vote down vote up
public void configureSpecificDialogSettings(IDialogSettings dialogSettings) {
    IDialogSettings equalsSettings = dialogSettings.getSection(EQUALS_SETTINGS_SECTION);
    if (equalsSettings == null) {
        equalsSettings = dialogSettings.addNewSection(EQUALS_SETTINGS_SECTION);
    }
    this.equalsDialogSettings = equalsSettings;

    compareReferences = equalsSettings.getBoolean(SETTINGS_COMPARE_REFERENCES);
    classComparison = equalsSettings.getBoolean(SETTINGS_CLASS_COMPARISON);
    classCast = equalsSettings.getBoolean(SETTINGS_CLASS_CAST);
}
 
Example 14
Source File: HybridProjectImportPage.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
private void restoreFromHistory(){
	//Directories
	IDialogSettings settings = getDialogSettings();
	if (settings == null) return;
	String[] sourceNames = settings.getArray(SETTINGSKEY_DIRECTORIES);
	if (sourceNames == null) {
		return; 
	}
	for (String dirname : sourceNames) {
		directoryPathField.add(dirname);
	}
	//copy to workspace
	copyFiles = settings.getBoolean(SETTINGSKEY_COPY);
	copyCheckbox.setSelection(copyFiles);
}
 
Example 15
Source File: JarRefactoringDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected Control createDialogArea(final Composite parent) {
	final Composite container= (Composite) super.createDialogArea(parent);
	initializeDialogUnits(container);
	final Composite composite= new Composite(container, SWT.NULL);
	final GridLayout layout= new GridLayout();
	layout.marginHeight= 0;
	layout.marginWidth= 0;
	composite.setLayout(layout);
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
	final RefactoringHistoryControlConfiguration configuration= new RefactoringHistoryControlConfiguration(null, true, true) {

		@Override
		public final String getWorkspaceCaption() {
			return JarPackagerMessages.JarRefactoringDialog_workspace_caption;
		}
	};
	fHistoryControl= (ISortableRefactoringHistoryControl) RefactoringUI.createSortableRefactoringHistoryControl(composite, configuration);
	fHistoryControl.createControl();
	boolean sortProjects= true;
	final IDialogSettings settings= fSettings;
	if (settings != null)
		sortProjects= settings.getBoolean(SETTING_SORT);
	if (sortProjects)
		fHistoryControl.sortByProjects();
	else
		fHistoryControl.sortByDate();
	GridData data= new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
	data.heightHint= convertHeightInCharsToPixels(32);
	data.widthHint= convertWidthInCharsToPixels(72);
	fHistoryControl.getControl().setLayoutData(data);
	fHistoryControl.setInput(fHistory);
	fHistoryControl.setCheckedDescriptors(fData.getRefactoringDescriptors());
	createPlainLabel(composite, JarPackagerMessages.JarPackageWizardPage_options_label);
	createOptionsGroup(composite);
	Dialog.applyDialogFont(parent);
	return composite;
}
 
Example 16
Source File: FilteredTypesSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected void restoreDialog(IDialogSettings settings) {
	super.restoreDialog(settings);

	if (! BUG_184693) {
		boolean showContainer= settings.getBoolean(SHOW_CONTAINER_FOR_DUPLICATES);
		fShowContainerForDuplicatesAction.setChecked(showContainer);
		fTypeInfoLabelProvider.setContainerInfo(showContainer);
	} else {
		fTypeInfoLabelProvider.setContainerInfo(true);
	}

	if (fAllowScopeSwitching) {
		String setting= settings.get(WORKINGS_SET_SETTINGS);
		if (setting != null) {
			try {
				IMemento memento= XMLMemento.createReadRoot(new StringReader(setting));
				fFilterActionGroup.restoreState(memento);
			} catch (WorkbenchException e) {
				// don't do anything. Simply don't restore the settings
				JavaPlugin.log(e);
			}
		}
		IWorkingSet ws= fFilterActionGroup.getWorkingSet();
		if (ws == null || (ws.isAggregateWorkingSet() && ws.isEmpty())) {
			setSearchScope(SearchEngine.createWorkspaceScope());
			setSubtitle(null);
		} else {
			setSearchScope(JavaSearchScopeFactory.getInstance().createJavaSearchScope(ws, true));
			setSubtitle(ws.getLabel());
		}
	}

	// TypeNameMatch[] types = OpenTypeHistory.getInstance().getTypeInfos();
	//
	// for (int i = 0; i < types.length; i++) {
	// TypeNameMatch type = types[i];
	// accessedHistoryItem(type);
	// }
}
 
Example 17
Source File: ImportTraceWizardPage.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
@Override
protected void restoreWidgetValues() {
    super.restoreWidgetValues();

    IDialogSettings settings = getDialogSettings();
    boolean value;
    if (fImportUnrecognizedButton != null) {
        if (settings.get(getPageStoreKey(IMPORT_WIZARD_IMPORT_UNRECOGNIZED_ID)) == null) {
            value = false;
        } else {
            value = settings.getBoolean(getPageStoreKey(IMPORT_WIZARD_IMPORT_UNRECOGNIZED_ID));
        }
        fImportUnrecognizedButton.setSelection(value);
    }

    if (fPreserveFolderStructureButton != null) {
        if (settings.get(getPageStoreKey(IMPORT_WIZARD_PRESERVE_FOLDERS_ID)) == null) {
            value = true;
        } else {
            value = settings.getBoolean(getPageStoreKey(IMPORT_WIZARD_PRESERVE_FOLDERS_ID));
        }
        fPreserveFolderStructureButton.setSelection(value);
    }

    if (fCreateExperimentCheckbox != null) {
        if (settings.get(getPageStoreKey(IMPORT_WIZARD_CREATE_EXPERIMENT_ID)) == null) {
            value = false;
        } else {
            value = settings.getBoolean(getPageStoreKey(IMPORT_WIZARD_CREATE_EXPERIMENT_ID));
        }
        fCreateExperimentCheckbox.setSelection(value);
        fExperimentNameText.setEnabled(fCreateExperimentCheckbox.getSelection());
    }

    if (settings.get(getPageStoreKey(IMPORT_WIZARD_IMPORT_FROM_DIRECTORY_ID)) == null) {
        value = true;
    } else {
        value = settings.getBoolean(getPageStoreKey(IMPORT_WIZARD_IMPORT_FROM_DIRECTORY_ID));
    }

    if (directoryNameField != null) {
        restoreComboValues(directoryNameField, settings, getPageStoreKey(IMPORT_WIZARD_ROOT_DIRECTORY_ID));
    }
    if (fArchiveNameField != null) {
        restoreComboValues(fArchiveNameField, settings, getPageStoreKey(IMPORT_WIZARD_ARCHIVE_FILE_NAME_ID));
    }

    if (fImportFromDirectoryRadio != null) {
        fImportFromDirectoryRadio.setSelection(value);
        if (value) {
            directoryRadioSelected();
        }
    }
    if (fImportFromArchiveRadio != null) {
        fImportFromArchiveRadio.setSelection(!value);
        if (!value) {
            archiveRadioSelected();
        }
    }
}
 
Example 18
Source File: ModulaQuickOutlineDialog.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
private static boolean getStateForSizeOrLocation(boolean size) {
    IDialogSettings settings = getDialogSettingsStatic();
    return settings.getBoolean(size ? DLG_USE_PERSISTED_SIZE : DLG_USE_PERSISTED_LOCATION);
}
 
Example 19
Source File: JavadocOptionsManager.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
private void loadFromDialogStore(IDialogSettings settings, List<?> sel) {
	fInitialElements= getInitialElementsFromSelection(sel);

	IJavaProject project= getSingleProjectFromInitialSelection();

	fAccess= settings.get(VISIBILITY);
	if (fAccess == null)
		fAccess= PROTECTED;

	//this is defaulted to false.
	fFromStandard= settings.getBoolean(FROMSTANDARD);

	//doclet is loaded even if the standard doclet is being used
	fDocletpath= settings.get(DOCLETPATH);
	fDocletname= settings.get(DOCLETNAME);
	if (fDocletpath == null || fDocletname == null) {
		fFromStandard= true;
		fDocletpath= ""; //$NON-NLS-1$
		fDocletname= ""; //$NON-NLS-1$
	}


	if (project != null) {
		fAntpath= getRecentSettings().getAntpath(project);
	} else {
		fAntpath= settings.get(ANTPATH);
		if (fAntpath == null) {
			fAntpath= ""; //$NON-NLS-1$
		}
	}


	if (project != null) {
		fDestination= getRecentSettings().getDestination(project);
	} else {
		fDestination= settings.get(DESTINATION);
		if (fDestination == null) {
			fDestination= ""; //$NON-NLS-1$
		}
	}

	fTitle= settings.get(TITLE);
	if (fTitle == null)
		fTitle= ""; //$NON-NLS-1$

	fStylesheet= settings.get(STYLESHEETFILE);
	if (fStylesheet == null)
		fStylesheet= ""; //$NON-NLS-1$

	fVMParams= settings.get(VMOPTIONS);
	if (fVMParams == null)
		fVMParams= ""; //$NON-NLS-1$

	fAdditionalParams= settings.get(EXTRAOPTIONS);
	if (fAdditionalParams == null)
		fAdditionalParams= ""; //$NON-NLS-1$

	fOverview= settings.get(OVERVIEW);
	if (fOverview == null)
		fOverview= ""; //$NON-NLS-1$

	fUse= loadBoolean(settings.get(USE));
	fAuthor= loadBoolean(settings.get(AUTHOR));
	fVersion= loadBoolean(settings.get(VERSION));
	fNodeprecated= loadBoolean(settings.get(NODEPRECATED));
	fNoDeprecatedlist= loadBoolean(settings.get(NODEPRECATEDLIST));
	fNonavbar= loadBoolean(settings.get(NONAVBAR));
	fNoindex= loadBoolean(settings.get(NOINDEX));
	fNotree= loadBoolean(settings.get(NOTREE));
	fSplitindex= loadBoolean(settings.get(SPLITINDEX));
	fOpenInBrowser= loadBoolean(settings.get(OPENINBROWSER));

	fSource= settings.get(SOURCE);
	if (project != null) {
		fSource= project.getOption(JavaCore.COMPILER_SOURCE, true);
	}

	if (project != null) {
		fHRefs= getRecentSettings().getHRefs(project);
	} else {
		fHRefs= new String[0];
	}
}
 
Example 20
Source File: PySearchInOpenDocumentsAction.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void run() {
    IDialogSettings settings = TextEditorPlugin.getDefault().getDialogSettings();
    IDialogSettings s = settings.getSection("org.eclipse.ui.texteditor.FindReplaceDialog");
    boolean caseSensitive = false;
    boolean wholeWord = false;
    boolean isRegEx = false;
    if (s != null) {
        caseSensitive = s.getBoolean("casesensitive"); //$NON-NLS-1$
        wholeWord = s.getBoolean("wholeword"); //$NON-NLS-1$
        isRegEx = s.getBoolean("isRegEx"); //$NON-NLS-1$
    }

    String searchText = "";
    if (parameters != null) {
        searchText = StringUtils.join(" ", parameters);
    }
    if (searchText.length() == 0) {
        PySelection ps = PySelectionFromEditor.createPySelectionFromEditor(edit);
        try {
            searchText = ps.getSelectedText();
        } catch (BadLocationException e) {
            searchText = "";
        }
    }
    IStatusLineManager statusLineManager = edit.getStatusLineManager();
    if (searchText.length() == 0) {
        InputDialog d = new InputDialog(EditorUtils.getShell(), "Text to search", "Enter text to search.", "",
                null);

        int retCode = d.open();
        if (retCode == InputDialog.OK) {
            searchText = d.getValue();
        }
    }

    if (searchText.length() >= 0) {
        if (wholeWord && !isRegEx && isWord(searchText)) {
            isRegEx = true;
            searchText = "\\b" + searchText + "\\b";
        }

        FindInOpenDocuments.findInOpenDocuments(searchText, caseSensitive, wholeWord, isRegEx, statusLineManager);
    }
}