Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Event


                fTable.setRedraw(true);
                itemCount = fTable.getItemCount();
            }
            // table empty -> no selection
            if (fCount == 0) {
                fTable.notifyListeners(SWT.Selection, new Event());
                return Status.OK_STATUS;
            }
            // How many we are going to do this time.
            int iterations = Math.min(10, fCount - currentIndex);
            for (int i = 0; i < iterations; i++) {
                if (monitor.isCanceled()) {
          return Status.CANCEL_STATUS;
        }
                final TableItem item = (currentIndex < itemCount) ? fTable
                        .getItem(currentIndex)
                        : new TableItem(fTable, SWT.NONE);
                final Label label = fLabels[fFilteredIndices[fFoldedIndices[currentIndex]]];
                item.setText(label.string);
                item.setImage(label.image);
                currentIndex++;
            }
            if (monitor.isCanceled()) {
        return Status.CANCEL_STATUS;
      }
            if (currentIndex < fCount) {
        schedule(100);
      } else {
                if (indicesToSelect == null) {
                   // Make a default selection in the table if there is none.
                  // If a selection has already been made, honor it.
                  // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=112146
                    if (fCount > 0) {
                      if (fTable.getSelectionIndices().length == 0) {
                        defaultSelect();
                      } else {
                        // There is a selection, but it likely hasn't changed since the
                        // job started.  Force a selection notification, since the
                        // items represented by the selection have changed.
              // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=119456
                        fTable.notifyListeners(SWT.Selection, new Event());
                      }
                    }
                } else {
                  // Set the selection as indicated.
                    selectAndNotify(indicesToSelect);
View Full Code Here


      // before the update finished. If so then leave
      if (fTable.isDisposed()) {
        return;
      }
      fTable.setSelection(indices);
      fTable.notifyListeners(SWT.Selection, new Event());
    }
View Full Code Here

            if (list.getElementAt(list.getTable()
                .getSelectionIndex() - 1) instanceof ItemsListSeparator)
              list.getTable().setSelection(
                  list.getTable().getSelectionIndex() - 1);
            list.getTable().notifyListeners(SWT.Selection,
                new Event());

          }
        }

        if (e.keyCode == SWT.ARROW_DOWN
            && (e.stateMask & SWT.SHIFT) != 0
            && (e.stateMask & SWT.CTRL) != 0) {

          if (list
              .getElementAt(list.getTable().getSelectionIndex() + 1) instanceof ItemsListSeparator)
            list.getTable().setSelection(
                list.getTable().getSelectionIndex() + 1);
          list.getTable().notifyListeners(SWT.Selection, new Event());
        }

      }
    });
View Full Code Here

          list.setSelection(new StructuredSelection(
              lastRefreshSelection));
        } else {
          refreshWithLastSelection = true;
          list.getTable().setSelection(0);
          list.getTable().notifyListeners(SWT.Selection, new Event());
        }
      } else {
        list.setSelection(StructuredSelection.EMPTY);
      }
View Full Code Here

      // Decide what type of delegate we have.
      if ((delegate instanceof IActionDelegate2)
          && (trigger instanceof Event)) {
        // This supports Eclipse 2.1 to Eclipse 3.1.
        final IActionDelegate2 delegate2 = (IActionDelegate2) delegate;
        final Event triggeringEvent = (Event) trigger;
        delegate2.runWithEvent(action, triggeringEvent);
      } else if ((delegate instanceof IActionDelegateWithEvent)
          && (trigger instanceof Event)) {
        // This supports Eclipse 2.0
        final IActionDelegateWithEvent delegateWithEvent = (IActionDelegateWithEvent) delegate;
        final Event triggeringEvent = (Event) trigger;
        delegateWithEvent.runWithEvent(action, triggeringEvent);
      } else {
        delegate.run(action);
      }
    }
View Full Code Here

        if ((action.getStyle() == IAction.AS_CHECK_BOX)
                || (action.getStyle() == IAction.AS_RADIO_BUTTON)) {
      action.setChecked(!action.isChecked());
    }
        try {
            action.runWithEvent(new Event());
        } catch (Exception e) {
            throw new ExecutionException(
                    "While executing the action, an exception occurred", e); //$NON-NLS-1$
        }
        return null;
View Full Code Here

    private static void handleMouseMove(Event e) {
        if (currentListener != null && dragEvent != null && hasMovedEnough(e)) {
            if (dragSource != null && !dragSource.isDisposed()
                    && dragSource == e.widget) {
                Event de = dragEvent;
               
                // cache the current value so we can restore it later
                int originalMouseButton = de.button;
               
                // Update the button field so that the drag listener
View Full Code Here

   
    /**
     * @return
     */
    private Event createCheckboxEvent() {
        Event event = new Event();
        event.widget = page.createTemplateInJavaFolderCheckbox;
        return event;
    }
View Full Code Here

      ReflectionUtils.invokeMethod(oleClientSite, "setExtent(int,int)", bounds.width, bounds.height);
      // force STATE_RUNNING, during Popup displaying it can be in STATE_UIACTIVE
      ReflectionUtils.setField(oleClientSite, "state", 1);
      // ask for painting
      {
        Event event = new Event();
        event.gc = gc;
        ReflectionUtils.invokeMethod(oleClientSite, "onPaint(org.eclipse.swt.widgets.Event)", event);
      }
    } finally {
      gc.dispose();
View Full Code Here

   * @return
   */
  private List<MenuItem> findMenusInternal(final Menu bar, final Matcher<?> matcher, final boolean recursive) {
    LinkedHashSet<MenuItem> result = new LinkedHashSet<MenuItem>();
    if (bar != null) {
      bar.notifyListeners(SWT.Show, new Event());
      MenuItem[] items = bar.getItems();
      for (MenuItem menuItem : items) {
        if (isSeparator(menuItem)) {
          continue;
        }
        if (matcher.matches(menuItem))
          result.add(menuItem);
        if (recursive)
          result.addAll(findMenusInternal(menuItem.getMenu(), matcher, recursive));
      }
      bar.notifyListeners(SWT.Hide, new Event());
    }
    return new ArrayList<MenuItem>(result);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.widgets.Event

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.