Package org.eclipse.jface.window

Examples of org.eclipse.jface.window.ToolTip$TooltipHideListener


    }
   
    int messageLabelUnclippedHeight = messageLabel.computeSize(messageLabel.getSize().x - xTrim, SWT.DEFAULT, true).y;
    boolean messageLabelClipped = messageLabelUnclippedHeight > messageLabel.getSize().y - yTrim;
    if (messageLabel.getData() instanceof ToolTip) {
      ToolTip toolTip = (ToolTip) messageLabel.getData();
      toolTip.hide();
      toolTip.deactivate();
      messageLabel.setData(null);
    }
    if (messageLabelClipped) {
      ToolTip tooltip = new ToolTip(messageLabel, ToolTip.NO_RECREATE, false) {
       
        protected Composite createToolTipContentArea(Event event, Composite parent) {
          Composite result = new Composite(parent, SWT.NONE);
          result.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
          result.setLayout(new GridLayout());
          Text text = new Text(result, SWT.WRAP);
          text.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
          text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
          text.setText(messageLabel.getText());
          GridData gridData = new GridData();
          gridData.widthHint = messageLabel.getSize().x;
          text.setLayoutData(gridData);
          Dialog.applyDialogFont(result);
          return result;
        }
        public Point getLocation(Point tipSize, Event event) {
          return messageLabel.getShell().toDisplay(messageLabel.getLocation());
        }
      };
      messageLabel.setData(tooltip);
      tooltip.setPopupDelay(0);
      tooltip.activate();
    }
  }
View Full Code Here


        // TODO should we update the diagram's selection too?
      }
    });
    final Tree tree = (Tree)viewer.getControl();
    ToolTip tooltip = new DefaultToolTip(tree) {
      @Override
      protected String getText(Event event) {
        TreeItem item = tree.getItem(new Point(event.x, event.y));
        if (item != null) {
          Object data = item.getData();
View Full Code Here

          if (help != null) {
            final Button propertyHelp = factory.createButton(workParent, "", SWT.BUTTON1);
            propertyHelp.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_LCL_LINKTO_HELP));

            // create a tooltip
            final ToolTip tooltip = new FormToolTip(propertyHelp, String.format("Help for field %s",
                    property.displayName().equals("") ? fieldInfo.getFieldName() : property.displayName()), help.displayHelpShort(), help.displayHelpLong());
            tooltip.setHideOnMouseDown(false);

            data = new FormData();
            data.top = new FormAttachment(createdControl, 0, SWT.TOP);
            data.left = new FormAttachment(createdControl, 0);
            propertyHelp.setLayoutData(data);
            propertyHelp.addMouseListener(new MouseListener() {

              @Override
              public void mouseUp(MouseEvent e) {
              }

              @Override
              public void mouseDown(MouseEvent e) {
                tooltip.show(new Point(0, 0));
              }

              @Override
              public void mouseDoubleClick(MouseEvent e) {
              }
View Full Code Here

      public void open(OpenEvent e) {
        message((IStructuredSelection) e.getSelection());
      }
    });

    ToolTip toolTip = new ViewerToolTip(treeViewer.getControl());
    toolTip.setHideOnMouseDown(false);
    toolTip.setPopupDelay(200);
    toolTip.setShift(new Point(5, 5));

    makeActions();
    hookContextMenu();
    contributeToActionBars();
    hookDropSupport();
View Full Code Here

    });

    JFaceResources.getColorRegistry().put(ViewerToolTip.HEADER_BG_COLOR, new RGB(255, 255, 255));
    JFaceResources.getFontRegistry().put(ViewerToolTip.HEADER_FONT, JFaceResources.getFontRegistry().getBold(JFaceResources.getDefaultFont().getFontData()[0].getName()).getFontData());

    final ToolTip toolTip = new ViewerToolTip(teamChat.getTableViewer().getControl());
    toolTip.setHideOnMouseDown(false);
    toolTip.setPopupDelay(200);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.window.ToolTip$TooltipHideListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.