toolTip = new DefaultToolTip( viewTreeComposite, ToolTip.RECREATE, true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true );
toolTip = new DefaultToolTip( canvas, ToolTip.NO_RECREATE, true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true );
toolTip = new DefaultToolTip( canvas, ToolTip.NO_RECREATE, true ); toolTip.setRespectMonitorBounds( true ); toolTip.setRespectDisplayBounds( true );
props.setLook( list ); list.setItems( getVariableNames( variables ) ); final DefaultToolTip toolTip = new DefaultToolTip( list, ToolTip.RECREATE, true ); toolTip.setImage( GUIResource.getInstance().getImageVariable() ); toolTip.setHideOnMouseDown( true );
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(); } } ); }
private static void showToolTipSWTJface(Control control, int style, String title, String message) { DefaultToolTip tooltip = new DefaultToolTip(control, org.eclipse.jface.window.ToolTip.NO_RECREATE, true); tooltip.setHideDelay(TOOLTIP_HIDE_DELAY); tooltip.setText("[" + title+ "]\n\n" + message); tooltip.setImage(control.getDisplay().getSystemImage(/*SWT.ICON_INFORMATION*/ style)); tooltip.show(control.toDisplay(control.getSize().x/2, 5)); }