Beispiel #1
0
  public void run() {
    Object o;

    while (!quit) {
      o = null;

      try {
        while (counter > 0) {
          Thread.sleep(300);
          counter--;
        }
      } catch (InterruptedException e) {
      }

      synchronized (queue) {
        if (queue.size() > 0) {
          /*
          				//#debug info
          				System.out.println("queue firstElement tooltip: " + queue.firstElement());

              			for(int i = 0; i < queue.size() ; i++ )
              			{
              				//#debug info
              				System.out.println("queue[" + i + "] tooltip: " + queue.elementAt(i));
              			}

          				//#debug info
          				System.out.println("queue lastElement tooltip: " + queue.lastElement());
          */
          o = queue.lastElement();
          queue.removeAllElements();
        } else {
          try {
            queue.wait();
          } catch (InterruptedException e) {
          }
        }
      }

      if (o != null) {

        boolean setTooltip = false;

        if (_cutomTableItem.getClass() == CustomTableItem.class) {
          CustomImageItem customImageItem = (CustomImageItem) _tooltipObject;
          if ((_cutomTableItem.getFocusedItem() == customImageItem)
              && _cutomTableItem.isFocused
              && _cutomTableItem._workingForm.isActive()) {
            setTooltip = true;
          }
        }

        if (setTooltip == true) {
          // #style .centeredCell
          tooltipAlert.setString(o.toString());
          tooltipAlert.setTimeout(4000);

          if (!tooltipAlert.isShown()) {
            Utility.show(Display.getDisplay(ABSALive.getInstance()), tooltipAlert);
          }
        }
      }
    }
  }