toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( 350 ); toolTip.setHideDelay( 5000 );
toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( 350 ); toolTip.setShift( new org.eclipse.swt.graphics.Point( ConstUI.TOOLTIP_OFFSET, ConstUI.TOOLTIP_OFFSET ) );
toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( 350 ); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT );
toolTip.setHideOnMouseDown( true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( 350 );
protected void addColumnTooltip( Table table, int columnIndex ) { final DefaultToolTip toolTip = new DefaultToolTip( table, ToolTip.RECREATE, true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( TOOLTIP_SHOW_DELAY ); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY ); toolTip.setShift( new Point( ConstUI.TOOLTIP_OFFSET, ConstUI.TOOLTIP_OFFSET ) ); table.addMouseTrackListener( new MouseTrackAdapter() { @Override public void mouseHover( MouseEvent e ) { Point coord = new Point( e.x, e.y ); TableItem item = table.getItem( coord ); if ( item != null ) { if ( item.getBounds( columnIndex ).contains( coord ) ) { String contents = item.getText( columnIndex ); if ( !Utils.isEmpty( contents ) ) { toolTip.setText( contents ); toolTip.show( coord ); return; } } } toolTip.hide(); } @Override public void mouseExit( MouseEvent e ) { toolTip.hide(); } } ); }
protected void addColumnTooltip( Table table, int columnIndex ) { final DefaultToolTip toolTip = new DefaultToolTip( table, ToolTip.RECREATE, true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( TOOLTIP_SHOW_DELAY ); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY ); toolTip.setShift( new Point( ConstUI.TOOLTIP_OFFSET, ConstUI.TOOLTIP_OFFSET ) ); table.addMouseTrackListener( new MouseTrackAdapter() { @Override public void mouseHover( MouseEvent e ) { Point coord = new Point( e.x, e.y ); TableItem item = table.getItem( coord ); if ( item != null ) { if ( item.getBounds( columnIndex ).contains( coord ) ) { String contents = item.getText( columnIndex ); if ( !Utils.isEmpty( contents ) ) { toolTip.setText( contents ); toolTip.show( coord ); return; } } } toolTip.hide(); } @Override public void mouseExit( MouseEvent e ) { toolTip.hide(); } } ); }
protected void addColumnTooltip( Table table, int columnIndex ) { final DefaultToolTip toolTip = new DefaultToolTip( table, ToolTip.RECREATE, true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( TOOLTIP_SHOW_DELAY ); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY ); toolTip.setShift( new Point( ConstUI.TOOLTIP_OFFSET, ConstUI.TOOLTIP_OFFSET ) ); table.addMouseTrackListener( new MouseTrackAdapter() { @Override public void mouseHover( MouseEvent e ) { Point coord = new Point( e.x, e.y ); TableItem item = table.getItem( coord ); if ( item != null ) { if ( item.getBounds( columnIndex ).contains( coord ) ) { String contents = item.getText( columnIndex ); if ( !Utils.isEmpty( contents ) ) { toolTip.setText( contents ); toolTip.show( coord ); return; } } } toolTip.hide(); } @Override public void mouseExit( MouseEvent e ) { toolTip.hide(); } } ); }