protected void hideToolTips() { toolTip.hide(); helpTip.hide(); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT ); }
@Override public void mouseHover( MouseEvent e ) { boolean tip = true; boolean isDeprecated = false; toolTip.hide(); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT ); Point real = screen2real( e.x, e.y ); AreaOwner areaOwner = getVisibleAreaOwner( real.x, real.y ); if ( areaOwner != null && areaOwner.getAreaType() != null ) { switch ( areaOwner.getAreaType() ) { case STEP_ICON: StepMeta stepMeta = (StepMeta) areaOwner.getOwner(); isDeprecated = stepMeta.isDeprecated(); if ( !stepMeta.isMissing() && !mouseOverSteps.contains( stepMeta ) ) { addStepMouseOverDelayTimer( stepMeta ); redraw(); tip = false; } break; default: break; } } // Show a tool tip upon mouse-over of an object on the canvas if ( ( tip && !helpTip.isVisible() ) || isDeprecated ) { setToolTip( real.x, real.y, e.x, e.y ); } }
toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_LONG );
toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( 350 ); toolTip.setHideDelay( 5000 ); toolTip.setShift( new org.eclipse.swt.graphics.Point( ConstUI.TOOLTIP_OFFSET, ConstUI.TOOLTIP_OFFSET ) );
toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT );
toolTip.setRespectDisplayBounds( true ); toolTip.setPopupDelay( 350 ); toolTip.setHideDelay( TOOLTIP_HIDE_DELAY_SHORT ); toolTip.setShift( new org.eclipse.swt.graphics.Point( ConstUI.TOOLTIP_OFFSET, ConstUI.TOOLTIP_OFFSET ) );
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)); }