Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.ant.internal.ui.views.actions
Class SearchForBuildFilesDialog  view SearchForBuildFilesDialog download SearchForBuildFilesDialog.java

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended byorg.eclipse.jface.dialogs.InputDialog
              extended byorg.eclipse.ant.internal.ui.views.actions.SearchForBuildFilesDialog

public class SearchForBuildFilesDialog
extends org.eclipse.jface.dialogs.InputDialog

This dialog allows the user to search for Ant build files whose names match a given pattern. The search may be performed on the entire workspace or it can be limited to a particular working set.


Nested Class Summary
(package private)  class SearchForBuildFilesDialog.ResourceProxyVisitor
          Searches for files whose name matches the given regular expression.
 
Nested classes inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
 
Field Summary
private  org.eclipse.swt.widgets.Button includeErrorResultButton
          The button that allows the user to decide if error results should be parsed
private  java.util.List results
          List of IFile objects that were found
private  java.util.List searchScopes
          List of IResource objects in which to search.
private static org.eclipse.jface.dialogs.IDialogSettings settings
          The dialog settings used to persist this dialog's settings.
private  org.eclipse.swt.widgets.Button workingSetScopeButton
          The working set scope radio button.
private  org.eclipse.swt.widgets.Text workingSetText
          The text field that displays the current working set name
private  org.eclipse.swt.widgets.Button workspaceScopeButton
          The workspace scope radio button.
 
Fields inherited from class org.eclipse.jface.dialogs.InputDialog
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, dialogArea, DLG_IMG_ERROR, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
SearchForBuildFilesDialog()
          Creates a new dialog to search for build files.
 
Method Summary
protected  void configureShell(org.eclipse.swt.widgets.Shell shell)
          Configures the given shell in preparation for opening this window in it.
protected  void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
          Change the label on the "Ok" button and initialize the enabled state
protected  org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
          Add the scope selection widgets to the dialog area
private  void createIncludeErrorResultButton(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.graphics.Font font)
          Creates the button that allows the user to specify whether or not build files should that cannot be parsed should be included in the results.
private  void createScopeGroup(org.eclipse.swt.widgets.Composite composite, org.eclipse.swt.graphics.Font font)
           
protected  boolean getIncludeErrorResults()
          Returns whether the user wishes to include results which cannot be parsed.
private  java.lang.String getInput()
          Returns the trimmed user input
 org.eclipse.core.resources.IFile[] getResults()
          Returns the search results
private  java.lang.String getWorkingSetName()
          Returns the working set name currently displayed.
private  void handleChooseButtonPressed()
          Handles the working set choose button pressed.
private  void handleRadioButtonPressed()
          One of the search scope radio buttons has been pressed.
protected  void okPressed()
          When the user presses the search button (tied to the OK id), search the workspace for files matching the regular expression in the input field.
private  void selectRadioButton(org.eclipse.swt.widgets.Button button)
          Programatically selects the given radio button, deselecting the other radio button.
private  void setWorkingSet(org.eclipse.ui.IWorkingSet set)
          Sets the current working set search scope.
private  void updateForWorkingSetSettings()
          Updates the dialog based on the state of the working set settings Sets the enablement of the "Search" button based on the validity of the settings Sets any or clears the error message
protected  void validateInput()
          Validates the input.
 
Methods inherited from class org.eclipse.jface.dialogs.InputDialog
buttonPressed, getErrorMessageLabel, getOkButton, getText, getValidator, getValue, setErrorMessage
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getInitialLocation, getInitialSize, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setExceptionHandler, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

results

private java.util.List results
List of IFile objects that were found


searchScopes

private java.util.List searchScopes
List of IResource objects in which to search. If the searchScopes are null, the user has asked to search the workspace. If the searchScopes are empty, the user has asked to search a working set that has no resources.


workingSetScopeButton

private org.eclipse.swt.widgets.Button workingSetScopeButton
The working set scope radio button.


workspaceScopeButton

private org.eclipse.swt.widgets.Button workspaceScopeButton
The workspace scope radio button.


workingSetText

private org.eclipse.swt.widgets.Text workingSetText
The text field that displays the current working set name


includeErrorResultButton

private org.eclipse.swt.widgets.Button includeErrorResultButton
The button that allows the user to decide if error results should be parsed


settings

private static org.eclipse.jface.dialogs.IDialogSettings settings
The dialog settings used to persist this dialog's settings.

Constructor Detail

SearchForBuildFilesDialog

public SearchForBuildFilesDialog()
Creates a new dialog to search for build files.

Method Detail

createButtonsForButtonBar

protected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
Change the label on the "Ok" button and initialize the enabled state


createDialogArea

protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
Add the scope selection widgets to the dialog area


createScopeGroup

private void createScopeGroup(org.eclipse.swt.widgets.Composite composite,
                              org.eclipse.swt.graphics.Font font)

selectRadioButton

private void selectRadioButton(org.eclipse.swt.widgets.Button button)
Programatically selects the given radio button, deselecting the other radio button.


handleRadioButtonPressed

private void handleRadioButtonPressed()
One of the search scope radio buttons has been pressed. Update the dialog accordingly.


getWorkingSetName

private java.lang.String getWorkingSetName()
Returns the working set name currently displayed.


createIncludeErrorResultButton

private void createIncludeErrorResultButton(org.eclipse.swt.widgets.Composite composite,
                                            org.eclipse.swt.graphics.Font font)
Creates the button that allows the user to specify whether or not build files should that cannot be parsed should be included in the results.


updateForWorkingSetSettings

private void updateForWorkingSetSettings()
Updates the dialog based on the state of the working set settings
  • Sets the enablement of the "Search" button based on the validity of the settings
  • Sets any or clears the error message


handleChooseButtonPressed

private void handleChooseButtonPressed()
Handles the working set choose button pressed. Returns the name of the chosen working set or null if none.


setWorkingSet

private void setWorkingSet(org.eclipse.ui.IWorkingSet set)
Sets the current working set search scope. This populates the search scope with resources found in the given working set and updates the enabled state of the dialog based on the sets contents.


getInput

private java.lang.String getInput()
Returns the trimmed user input


getResults

public org.eclipse.core.resources.IFile[] getResults()
Returns the search results


getIncludeErrorResults

protected boolean getIncludeErrorResults()
Returns whether the user wishes to include results which cannot be parsed.


okPressed

protected void okPressed()
When the user presses the search button (tied to the OK id), search the workspace for files matching the regular expression in the input field.


configureShell

protected void configureShell(org.eclipse.swt.widgets.Shell shell)
Description copied from class: org.eclipse.jface.window.Window
Configures the given shell in preparation for opening this window in it.

The default implementation of this framework method sets the shell's image and gives it a grid layout. Subclasses may extend or reimplement.


validateInput

protected void validateInput()
Description copied from class: org.eclipse.jface.dialogs.InputDialog
Validates the input.

The default implementation of this framework method delegates the request to the supplied input validator object; if it finds the input invalid, the error message is displayed in the dialog's message line. This hook method is called whenever the text changes in the input field.