private int getDbObjectType( Object dbObj ) { return ( (DbObject) dbObj ).getType( ); }   private boolean isDbObjectTreeValid( TreeItem[] selection, int type ) { for ( int i = 1; i < selection.length; i++ ) { if ( !( selection[i].getData( ) instanceof DbObject ) ) { return false; } DbObject temp = (DbObject) selection[i].getData( );  if ( !isAcceptableDbObjectType( temp.getType( ) ) ) { return false; } if ( temp.getType( ) != type && isTableOrView( type ) ) { if ( isTableOrView( temp.getType( ) ) ) continue; else { return false; } } else if ( temp.getType( ) == type ) { continue; } else { return false; }  } return true; }   private boolean isAcceptableDbObjectType( int type ) { if ( type == DbObject.ROOT_NODE_TYPE || type == DbObject.PROCEDURE_TYPE ) { return false; } return true; }   private boolean isTableOrView( int type ) { if ( type != DbObject.TABLE_TYPE && type != DbObject.VIEW_TYPE ) { return false; } return true; }
	public void addDragSupportToTree( )	{		DragSource dragSource = new DragSource( availableDbObjectsTree, DND.DROP_COPY );		dragSource.setTransfer( new Transfer[]{TextTransfer.getInstance( )} );		dragSource.addDragListener( new DragSourceAdapter( ) {			public void dragStart( DragSourceEvent event )			{				TreeItem[] selection = availableDbObjectsTree.getSelection( );				selectionMac = availableDbObjectsTree.getSelection( );				if ( selection.length > 0 )				{					if ( selection[0].getData( ) instanceof DbObject )					{						if ( ( (DbObject) selection[0].getData( ) ).getType( ) == DbObject.PROCEDURE_TYPE )						{							event.doit = false;							return;						}					}					else if ( selection[0].getData( ) instanceof ProcedureParameter )					{						event.doit = false;						return;					}				}				else if ( selection.length <= 0						|| selection[0].getData( ) == null )				{					event.doit = false;					return;				}			}			public void dragSetData( DragSourceEvent event )			{				if ( TextTransfer.getInstance( )						.isSupportedType( event.dataType ) )				{					populateEventData( event );				}			}		} );	}