Examples of ToolTip


Examples of org.apache.pivot.wtk.Tooltip

    @Override
    public void tooltipTriggered(Component component, int x, int y) {
        String tooltipText = component.getTooltipText();

        if (tooltipText != null) {
            Tooltip tooltip = new Tooltip(new Label(tooltipText));

            Display display = component.getDisplay();
            Point location = component.mapPointToAncestor(display, x, y);

            // Ensure that the tooltip stays on screen
            int tooltipX = location.x + 16;
            int tooltipY = location.y;

            int tooltipHeight = tooltip.getPreferredHeight();
            if (tooltipY + tooltipHeight > display.getHeight()) {
                tooltipY -= tooltipHeight;
            }

            tooltip.setLocation(tooltipX, tooltipY);
            tooltip.open(component.getWindow());
        }
    }
View Full Code Here

Examples of org.damour.base.client.ui.ToolTip

    buildRepositoryTree(repositoryTreeNode, parentItem);
    buildingTree = false;
    if (createRootItem) {
      rootItem.setState(true);
      rootItemLabel.setText("/");
      new ToolTip(rootItemLabel, null, "File System");
      if (rootItem.getChildCount() == 0) {
        TreeItem hiddenItem = new TreeItem();
        rootItem.addItem(hiddenItem);
        new ToolTip(rootItemLabel, null, "File System (empty)");
        hiddenItem.setVisible(false);
      }
    }
    restoreTreeState();
  }
View Full Code Here

Examples of org.eclipse.jface.window.ToolTip

    }
   
    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

Examples of org.eclipse.swt.widgets.ToolTip

    /* Use Balloon Tooltip on Windows and Linux */
    else {

      /* Use a Tooltip to help the user understand the State Semantic */
      final ToolTip newStateToolTip = new ToolTip(getShell(), SWT.BALLOON);
      newStateToolTip.setMessage(Messages.StateConditionControl_NEW_HINT);
      newStateToolTip.setAutoHide(false);

      final ToolTip unreadStateToolTip = new ToolTip(getShell(), SWT.BALLOON);
      unreadStateToolTip.setMessage(Messages.StateConditionControl_UNREAD_HINT);
      unreadStateToolTip.setAutoHide(false);

      fNewState.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (fNewState.getSelection() && !fUnreadState.getSelection()) {
            Point toolTipLocation = toDisplay(fUnreadState.getLocation());
            toolTipLocation.y += fUnreadState.getSize().y;
            if (Application.IS_WINDOWS)
              toolTipLocation.x += 5;
            else if (Application.IS_LINUX)
              toolTipLocation.x += 12;

            unreadStateToolTip.setLocation(toolTipLocation);
            unreadStateToolTip.setVisible(true);
          } else {
            unreadStateToolTip.setVisible(false);
          }
        }
      });

      fUnreadState.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
          if (fUnreadState.getSelection() && !fNewState.getSelection()) {
            Point toolTipLocation = toDisplay(fNewState.getLocation());
            toolTipLocation.y += fNewState.getSize().y;
            if (Application.IS_WINDOWS)
              toolTipLocation.x += 5;
            else if (Application.IS_LINUX)
              toolTipLocation.x += 12;

            newStateToolTip.setLocation(toolTipLocation);
            newStateToolTip.setVisible(true);
          } else {
            newStateToolTip.setVisible(false);
          }
        }
      });

      fNewState.addFocusListener(new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent e) {
          newStateToolTip.setVisible(false);
        }

        @Override
        public void focusLost(FocusEvent e) {
          unreadStateToolTip.setVisible(false);
        }
      });

      fUnreadState.addFocusListener(new FocusAdapter() {
        @Override
        public void focusGained(FocusEvent e) {
          unreadStateToolTip.setVisible(false);
        }

        @Override
        public void focusLost(FocusEvent e) {
          newStateToolTip.setVisible(false);
        }
      });

      addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          unreadStateToolTip.dispose();
          newStateToolTip.dispose();
        }
      });
    }

View Full Code Here

Examples of org.eclipse.swt.widgets.ToolTip

   * @param property a TechnicalProperty
   */
  protected void addDefaultVertifyListener(final Control control,
      final TechnicalProperty property) {

    final ToolTip tip = new ToolTip(control.getShell(), SWT.BALLOON
        | SWT.ICON_ERROR);
    if (control instanceof Combo) {

      ((Combo) control).addVerifyListener(new VerifyListener() {


        @Override
        public void verifyText(VerifyEvent e) {
          String text = ((Combo) control).getText(); // calculate new
                                // text
          text = text.substring(0, e.start) + e.text
              + text.substring(e.end, text.length());
          String errorMsg = ConstraintValueValidator.validateValue(
              text, property);
          if (errorMsg != null) {

            tip.setMessage(errorMsg);
            tip.setAutoHide(true);
            tip.setVisible(true);
            ((Combo) control).setBackground( invalidBackgroundColor);
            ((Combo) control).setForeground( Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
            hasValidValue = false;
          } else {
            tip.setVisible(false);
            ((Combo) control).setBackground( Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
            ((Combo) control).setForeground( Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
            hasValidValue = true;
          }
        }
      });
    } else if (control instanceof Text) {
      ((Text) control).addVerifyListener(new VerifyListener() {

        @Override
        public void verifyText(VerifyEvent e) {
          String text = ((Text) control).getText(); // calculate new
                                // text
          text = text.substring(0, e.start) + e.text
              + text.substring(e.end, text.length());
          String errorMsg = ConstraintValueValidator.validateValue(
              text, property);
          if (errorMsg != null) {
            tip.setMessage(errorMsg);
            tip.setAutoHide(true);
            tip.setVisible(true);
            ((Text) control).setBackground(invalidBackgroundColor);
            ((Text) control).setForeground( Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
            hasValidValue = false;
          } else {
            tip.setVisible(false);
            ((Text) control).setBackground( Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
            ((Text) control).setForeground( Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
            hasValidValue = true;
          }
        }
View Full Code Here

Examples of org.eclipse.swt.widgets.ToolTip

        trayItem.setImage(new Image(parent.getDisplay(), "img/at.png"));

        String message = "Existem novas atualiza��es disponiveis para download. \nPara maiores informa��es clique aqui.";
        trayItem.setToolTipText(message);
       
        final ToolTip tip = new ToolTip(parent.getShell(), SWT.BALLOON | SWT.ICON_INFORMATION);
      tip.setMessage(message);
      tip.setText("Atualiza��o do Gerente Digital.");
      trayItem.setToolTip(tip);
      tip.setVisible(true);
       
        trayItem.addListener (SWT.Selection, new Listener () {
            public void handleEvent (Event event) {
                new UpdateUI(information.getUpdateList());
            }
        });

        tip.addListener (SWT.Selection, new Listener () {
          public void handleEvent (Event event) {
            new UpdateUI(information.getUpdateList());
          }
        });
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ToolTip

        trayItem.setImage(new Image(parent.getDisplay(), "img/icoKey.png"));

        String message = "Esta copia do Gerente Digital vai expirar em "+ Anakin.getInstance().getTheForceFoneTime() +" dias. \nClique aqui para ativar na internet.";
        trayItem.setToolTipText(message);
       
        final ToolTip tip = new ToolTip(parent.getShell(), SWT.BALLOON | SWT.ICON_WARNING);
      tip.setMessage(message);
      tip.setText("Ativa��o do Gerente Digital.");
      trayItem.setToolTip(tip);
      tip.setVisible(true);
       
        trayItem.addListener (SWT.Selection, new Listener () {
            public void handleEvent (Event event) {
                new ContactTheDarkSide(new Shell(), getMySelf()).open();
            }
        });

        tip.addListener (SWT.Selection, new Listener () {
          public void handleEvent (Event event) {
            new ContactTheDarkSide(new Shell(), getMySelf()).open();
          }
        });
  }
View Full Code Here

Examples of org.eclipse.swt.widgets.ToolTip

        trayItem.setImage(new Image(parent.getDisplay(), "img/at.png"));

        String message = "Existem novas atualiza��es do Gerente Digital\n disponiveis para download.";
        trayItem.setToolTipText(message);
       
        final ToolTip tip = new ToolTip(parent.getShell(), SWT.BALLOON | SWT.ICON_INFORMATION);
      tip.setMessage(message);
      tip.setText("Atualiza��o do Gerente Digital.");
      trayItem.setToolTip(tip);
      tip.setVisible(true);
       
        trayItem.addListener (SWT.Selection, new Listener () {
            public void handleEvent (Event event) {
                new UpdateUI(information.getUpdateList());
            }
        });

        tip.addListener (SWT.Selection, new Listener () {
          public void handleEvent (Event event) {
            new UpdateUI(information.getUpdateList());
          }
        });
  }
View Full Code Here

Examples of org.moxieapps.gwt.highcharts.client.ToolTip

                                                .setFont("normal 10px Verdana, sans-serif")))
                                .setPointClickEventHandler(this))
                .setColumnPlotOptions(
                        new ColumnPlotOptions().setBorderWidth(0).setMinPointLength(1).setPointPadding(.001))
                .setToolTip(
                        new ToolTip().setBorderColor(COLOR).setBorderWidth(1)
                                .setStyle(new Style().setFont("normal 10px Verdana, sans-serif"))
                                .setFormatter(new ToolTipFormatter()
                                {
                                    @Override
                                    public String format(ToolTipData toolTipData)
View Full Code Here

Examples of org.spiffyui.client.widgets.Tooltip

    {
        /*
         * Create a tooltip with a simple body.
         * Add an anchor that will show the tooltip.
         */
        final Tooltip tooltip = new Tooltip();
        tooltip.setBody(new HTML(Index.getStrings().tooltipBody()));
       
        final Anchor anchor = new Anchor(Index.getStrings().showTooltip());       
        final Timer showTooltip = new Timer() {
           
            @Override
            public void run()
            {
                tooltip.showRelativeTo(anchor);
            }
        };
        anchor.addMouseOverHandler(new MouseOverHandler() {
           
            @Override
            public void onMouseOver(MouseOverEvent event)
            {
                /*
                 * Show the tooltip after a delay
                 */
                showTooltip.schedule(tooltip.getAutoCloseTime());
            }
        });
        anchor.addMouseOutHandler(new MouseOutHandler() {

            @Override
            public void onMouseOut(MouseOutEvent event)
            {
                if (tooltip.isShowing()) {
                    /*
                     * Autoclose the tooltip after a delay
                     */
                    tooltip.startAutoCloseTimer();
                } else {
                    /*
                     * Cancel the delay to show the tooltip
                     */
                    showTooltip.cancel();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.