Runtime

## org.eclipse.gmf.runtime.common.ui.dialogs
Class ShowRelatedElementsPredefinedComposite

    java.lang.Object
      org.eclipse.swt.widgets.Widget
          org.eclipse.swt.widgets.Control
              org.eclipse.swt.widgets.Scrollable
                  org.eclipse.swt.widgets.Composite
                      org.eclipse.gmf.runtime.common.ui.dialogs.ShowRelatedElementsPredefinedComposite

All Implemented Interfaces:
  Drawable

public class ShowRelatedElementsPredefinedComposite
extends Composite

The common Show Related Elements Predefined Queries Composite. It contains a list of queries you may select from.

Field Summary
`protected static java.lang.String` `DEFAULT_STRING` Default string
`protected Button` `delete` Delete button
`protected Button` `details` Details button
`protected static java.lang.String` `DIALOG_SETTINGS_KEY` Dialog settings key
`protected IDialogSettings` `dialogSettings` Dialog settings for storing presets.
`protected boolean` `isDetails` If the Details is displayed
`protected java.util.List` `predefined` Data for the predefined queries
`protected List` `predefinedBox` Predefined list
`protected java.util.List` `queries` Data for the hardcoded queries
`protected SelectableElement` `rootElement` Root SelectableElement
`protected Button` `saveAs` Save As button
`protected InputDialog` `saveAsDialog` Save as dialog.
`protected IShowRelatedElementsWithDetails` `showDetails` Show Details button
`protected static java.lang.String` `SPECIAL_CLOSING` Closing a hardcoded query's display name
`protected static java.lang.String` `SPECIAL_OPENING` Opening a hardcoded query's display name
`static int` `VIEWER_HEIGHT` Tree viewer control's height for the hint
`protected int` `viewerWidth` Viewer width hint for the listbox viewer

Fields inherited from class org.eclipse.swt.widgets.Composite
`embeddedHandle`

Fields inherited from class org.eclipse.swt.widgets.Widget
`handle`

Constructor Summary
`ShowRelatedElementsPredefinedComposite(Composite parent, IShowRelatedElementsWithDetails sreWithDetails, SelectableElement root, java.util.List queriesList, int width, boolean detailsShown)` Constructor

Method Summary
`protected boolean` `containsSpecialCharacter(java.lang.String text)` Returns if the text string contains a special character.
`protected void` `contributeComposite(Composite parent)` Contribute a composite to the expansion group
`protected void` `contributeToList()` Contribute to the predefined queries List.
`protected java.lang.String[]` `convertPresetsToString(java.util.List presets)` Convert the presets to a string array used for serializing
`protected void` `createContents()` Creates content for this composite.
`protected void` `delete()` Handle a delete button press to delete the predefined setting.
`protected void` `detailsChanged()` Details were changed, so update the predefined box to select the first item.
`protected void` `handlePredefinedBoxSelection()` Handle when the user clicks on something in the predefined queries List.
`protected void` `makePredefinedSettingsButtons(Composite buttons)` Make the buttons for the predefined settings list.
`protected java.util.List` `readPresets(java.lang.String nameToIgnore)` Return a list of ShowRelatedElementsPreset objects.
`protected void` `saveAs()` Handle a save as for a predefined setting.

Methods inherited from class org.eclipse.swt.widgets.Composite
`changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList`

Methods inherited from class org.eclipse.swt.widgets.Scrollable
`computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar`

Methods inherited from class org.eclipse.swt.widgets.Control

`addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update`

Methods inherited from class org.eclipse.swt.widgets.Widget
`addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### saveAs

    protected Button saveAs

  Save As button

### delete

    protected Button delete

  Delete button

### details

    protected Button details

  Details button

### showDetails

    protected IShowRelatedElementsWithDetails showDetails

  Show Details button

### rootElement

    protected SelectableElement rootElement

  Root SelectableElement

### isDetails

    protected boolean isDetails

  If the Details is displayed

### predefinedBox

    protected List predefinedBox

  Predefined list

### predefined

    protected java.util.List predefined

  Data for the predefined queries

### queries

    protected java.util.List queries

  Data for the hardcoded queries

### dialogSettings

    protected final IDialogSettings dialogSettings

  Dialog settings for storing presets.

### VIEWER_HEIGHT

    public static int VIEWER_HEIGHT

  Tree viewer control's height for the hint

### viewerWidth

    protected int viewerWidth

  Viewer width hint for the listbox viewer

### saveAsDialog

    protected InputDialog saveAsDialog

  Save as dialog. Cached.

### SPECIAL_OPENING

    protected static final java.lang.String SPECIAL_OPENING

  Opening a hardcoded query's display name

  See Also:
    Constant Field Values

### SPECIAL_CLOSING

    protected static final java.lang.String SPECIAL_CLOSING

  Closing a hardcoded query's display name

  See Also:
    Constant Field Values

### DIALOG_SETTINGS_KEY

    protected static final java.lang.String DIALOG_SETTINGS_KEY

  Dialog settings key

  See Also:
    Constant Field Values

### DEFAULT_STRING

    protected static final java.lang.String DEFAULT_STRING

  Default string

Constructor Detail

### ShowRelatedElementsPredefinedComposite

    public ShowRelatedElementsPredefinedComposite(Composite parent,
                                                  IShowRelatedElementsWithDetails sreWithDetails,
                                                  SelectableElement root,
                                                  java.util.List queriesList,
                                                  int width,
                                                  boolean detailsShown)

  Constructor

Parameters:
  `parent` - the parent Composite that we will add our composite into
  `sreWithDetails` - for sending updated events
  `root` - SelectableElement root
  `queriesList` - list of hardcoded queries
  `width` - int Width of composite to show
  `detailsShown` - boolean true if details are shown, false if not shown

Method Detail

### createContents

    protected void createContents()

  Creates content for this composite. This includes the List of predefined queries and several.

### handlePredefinedBoxSelection

    protected void handlePredefinedBoxSelection()

  Handle when the user clicks on something in the predefined queries List. It could involve sending a message to update the details. Also update the delete button enablement.

### contributeToList

    protected void contributeToList()

  Contribute to the predefined queries List. Read in data. Add items to the List.

### containsSpecialCharacter

    protected boolean containsSpecialCharacter(java.lang.String text)

  Returns if the text string contains a special character.

  Parameters:
    `text` - string to check for special characters
  Returns:
    true if it contains a special character, false if it doesn't

### readPresets

    protected java.util.List readPresets(java.lang.String nameToIgnore)

  Return a list of ShowRelatedElementsPreset objects.

  Parameters:
    `nameToIgnore` - ignore this name when reading in the presets. Can be null if you do not want to ignore anything and read everything in.
  Returns:
    List of the presets. Items in the List are ShowRelatedElementsPreset objects

### convertPresetsToString

    protected java.lang.String[] convertPresetsToString(java.util.List presets)

  Convert the presets to a string array used for serializing

  Parameters:
    `presets` - List of ShowRelatedElementsPresets objects
  Returns:
    String array that contains the data of the presets

### saveAs

    protected void saveAs()

  Handle a save as for a predefined setting.

### makePredefinedSettingsButtons

    protected void makePredefinedSettingsButtons(Composite buttons)

  Make the buttons for the predefined settings list.

  Parameters:
    `buttons` - composite I will be adding the buttons to.

### delete

    protected void delete()

  Handle a delete button press to delete the predefined setting.

### contributeComposite

    protected void contributeComposite(Composite parent)

  Contribute a composite to the expansion group

  Parameters:
    `parent` - the parent expansion group composite that we are going to contribute to.

### detailsChanged

    protected void detailsChanged()

  Details were changed, so update the predefined box to select the first item.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.