org.eclipse.datatools.sqltools.sqlbuilder.actions
Class NewSQLStatementComposite

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.datatools.sqltools.sqlbuilder.actions.NewSQLStatementComposite
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener

public class NewSQLStatementComposite
extends org.eclipse.swt.widgets.Composite
implements org.eclipse.swt.events.ModifyListener, org.eclipse.swt.events.SelectionListener

This class creates a composite with statement name, type of statement template and whether to create the template in the SQL Builder or SQL editor.


Field Summary
static int STATEMENT_TYPE_NONE
           
static int STATEMENT_TYPE_SAMPLE
           
 
Fields inherited from class org.eclipse.swt.widgets.Composite
embeddedHandle
 
Fields inherited from class org.eclipse.swt.widgets.Widget
handle
 
Constructor Summary
NewSQLStatementComposite(org.eclipse.swt.widgets.Composite parent, int style)
          Creates an instance of this class with the given parent composite and style flags.
 
Method Summary
 java.lang.String getEditorID()
          Gets the ID of editor the user selected.
 org.eclipse.swt.widgets.Button getQueryBuilderButton()
          Gets the SQLBuilderEditor Button Widget
 org.eclipse.swt.widgets.Button getSQLEditorButton()
          Gets the SQLEditor Button Widget
 java.lang.String getStatementName()
          Gets the statement name that the user entered in the dialog.
 org.eclipse.swt.widgets.Text getStatementNameText()
          Gets the statementName Text widget.
 int getStatementType()
          Gets the statement type value that the user selected in the dialog.
 org.eclipse.swt.widgets.Combo getStatementTypeCombo()
          Gets the statementType combo widget.
 boolean getSupportsExtendedStatementTypesForEditor()
          Gets whether or not the extended statement types (SAMPLE, NONE) are supported for the SQL Editor.
 void modifyText(org.eclipse.swt.events.ModifyEvent evt)
          Gets called when the text widget that this object is listening to is modified.
 void setErrorLabelText(java.lang.String text)
           
 void setStatementName(java.lang.String statementName)
          Sets the statement name that the user entered in the dialog to the given name.
 void setStatementType(int statementType)
          Sets the statement type value that the user selected in the dialog to the given value.
 void setSupportsExtendedStatementTypesForEditor(boolean supported)
          Sets whether or not the extended statement types (SAMPLE, NONE) are supported for the SQL Editor.
 void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent evt)
          Gets called when the "default selection" occurs (for example, the user hits the return key in a Text widget).
 void widgetSelected(org.eclipse.swt.events.SelectionEvent evt)
          Gets called when the selection changes in a control that we are listening to.
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, computeSize, drawBackground, getBackgroundMode, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, 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, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, reskin, setData, setData, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATEMENT_TYPE_SAMPLE

public static final int STATEMENT_TYPE_SAMPLE
See Also:
Constant Field Values

STATEMENT_TYPE_NONE

public static final int STATEMENT_TYPE_NONE
See Also:
Constant Field Values
Constructor Detail

NewSQLStatementComposite

public NewSQLStatementComposite(org.eclipse.swt.widgets.Composite parent,
                                int style)
Creates an instance of this class with the given parent composite and style flags.

Parameters:
parent - the parent composite
style - the composite style
Method Detail

getEditorID

public java.lang.String getEditorID()
Gets the ID of editor the user selected. The value returned is an editor ID defined in the plugin.xml file of the editor.

Returns:
the ID of the editor the user wants to use

getStatementName

public java.lang.String getStatementName()
Gets the statement name that the user entered in the dialog.

Returns:
the statement name

getStatementType

public int getStatementType()
Gets the statement type value that the user selected in the dialog. See the statement type constants defined for this dialog.

Returns:
the statement type

getStatementNameText

public org.eclipse.swt.widgets.Text getStatementNameText()
Gets the statementName Text widget.

Returns:
the statementName Text widget

getStatementTypeCombo

public org.eclipse.swt.widgets.Combo getStatementTypeCombo()
Gets the statementType combo widget.

Returns:
the statementType combo widget

getQueryBuilderButton

public org.eclipse.swt.widgets.Button getQueryBuilderButton()
Gets the SQLBuilderEditor Button Widget

Returns:
the SQLBuilderEditor Button Widget

getSQLEditorButton

public org.eclipse.swt.widgets.Button getSQLEditorButton()
Gets the SQLEditor Button Widget

Returns:
the SQLEditor Button Widget

getSupportsExtendedStatementTypesForEditor

public boolean getSupportsExtendedStatementTypesForEditor()
Gets whether or not the extended statement types (SAMPLE, NONE) are supported for the SQL Editor. (The are never supported for the SQL Builder.)

Returns:
true when the extended statement types are supported, otherwise false

modifyText

public void modifyText(org.eclipse.swt.events.ModifyEvent evt)
Gets called when the text widget that this object is listening to is modified.

Specified by:
modifyText in interface org.eclipse.swt.events.ModifyListener
See Also:
ModifyListener.modifyText(org.eclipse.swt.events.ModifyEvent)

setStatementName

public void setStatementName(java.lang.String statementName)
Sets the statement name that the user entered in the dialog to the given name.

Parameters:
statementName - the statement name to set

setErrorLabelText

public void setErrorLabelText(java.lang.String text)

setStatementType

public void setStatementType(int statementType)
Sets the statement type value that the user selected in the dialog to the given value. See the statement type constants defined for this dialog.

Parameters:
statementType - the statement type to set

setSupportsExtendedStatementTypesForEditor

public void setSupportsExtendedStatementTypesForEditor(boolean supported)
Sets whether or not the extended statement types (SAMPLE, NONE) are supported for the SQL Editor. (The are never supported for the SQL Builder.)

Parameters:
supported - true when the extended statement types should be supported, otherwise false

widgetSelected

public void widgetSelected(org.eclipse.swt.events.SelectionEvent evt)
Gets called when the selection changes in a control that we are listening to.

Specified by:
widgetSelected in interface org.eclipse.swt.events.SelectionListener
Parameters:
evt - the selection event

widgetDefaultSelected

public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent evt)
Gets called when the "default selection" occurs (for example, the user hits the return key in a Text widget).

Specified by:
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListener
Parameters:
evt - the selection event