Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Widget


   *
   * @param e
   *            Event
   */
  public void handleEvent(Event e) {
    Widget source = e.widget;

    if (source == destinationBrowseButton) {
      handleDestinationBrowseButtonPressed();
    }

View Full Code Here


  }

  private List<Widget> getParents(final Widget w) {
    return UIThreadRunnable.syncExec(display, new ListResult<Widget>() {
      public List<Widget> run() {
        Widget parent = w;
        List<Widget> parents = new LinkedList<Widget>();
        while (parent != null) {
          parents.add(parent);
          parent = getParentResolver().getParent(parent);
        }
View Full Code Here

   * @param obj the object which should be a widget.
   * @return the result of invocation of Widget#getText()
   */
  public static String getText(final Object obj) {
    if ((obj instanceof Widget) && !((Widget) obj).isDisposed()) {
      Widget widget = (Widget) obj;
      String text = UIThreadRunnable.syncExec(widget.getDisplay(), new ReflectionInvoker(obj, "getText")); //$NON-NLS-1$
      text = text.replaceAll(Text.DELIMITER, "\n"); //$NON-NLS-1$
      return text;
    }
    return ""; //$NON-NLS-1$
  }
View Full Code Here

   * @return the result of invocation of Widget#getToolTipText()
   * @since 1.0
   */
  public static String getToolTipText(final Object obj) {
    if ((obj instanceof Widget) && !((Widget) obj).isDisposed()) {
      Widget widget = (Widget) obj;
      return UIThreadRunnable.syncExec(widget.getDisplay(), new ReflectionInvoker(obj, "getToolTipText")); //$NON-NLS-1$
    }
    return ""; //$NON-NLS-1$
  }
View Full Code Here

   * @since 1.0
   */
  public static Object invokeMethod(final Object object, String methodName) throws NoSuchMethodException, IllegalAccessException,
      InvocationTargetException {
    final Method method = object.getClass().getMethod(methodName, new Class[0]);
    Widget widget = null;
    final Object result;
    if (object instanceof Widget) {
      widget = (Widget) object;
      result = UIThreadRunnable.syncExec(widget.getDisplay(), new Result<Object>() {
        public Object run() {
          try {
            return method.invoke(object, new Object[0]);
          } catch (Exception niceTry) {
          }
View Full Code Here

    int widgetIndex = allWidgets.indexOf(obj);

    ListIterator<? extends Widget> listIterator = allWidgets.listIterator(widgetIndex);

    while (listIterator.hasPrevious()) {
      Widget previousWidget = listIterator.previous();
      if ((isLabel(previousWidget)) && mnemonicTextMatcher.matches(previousWidget))
        return true;
    }

    return false;
View Full Code Here

  public InGroup(Matcher matcher) {
    this.matcher = matcher;
  }

  protected boolean doMatch(Object obj) {
    Widget previousWidget = SWTUtils.previousWidget((Widget) obj);
    TreePath path = new PathGenerator().getPath((Widget) obj);
    int segmentCount = path.getSegmentCount();
    for (int i = 1; i < segmentCount; i++) {
      previousWidget = (Widget) path.getSegment(segmentCount - i - 1);
      if ((previousWidget instanceof Group) && matcher.matches(previousWidget))
View Full Code Here

    int widgetIndex = allWidgets.indexOf(obj);

    ListIterator<? extends Widget> listIterator = allWidgets.listIterator(widgetIndex);

    while (listIterator.hasPrevious()) {
      Widget previousWidget = listIterator.previous();
      if ((isLabel(previousWidget)) && mnemonicTextMatcher.matches(previousWidget))
        return true;
    }

    return false;
View Full Code Here

   * @param obj the object which should be a widget.
   * @return the result of invocation of Widget#getText()
   */
  public static String getText(final Object obj) {
    if ((obj instanceof Widget) && !((Widget) obj).isDisposed()) {
      Widget widget = (Widget) obj;
      String text = UIThreadRunnable.syncExec(widget.getDisplay(), new ReflectionInvoker(obj, "getText")); //$NON-NLS-1$
      text = text.replaceAll(Text.DELIMITER, "\n"); //$NON-NLS-1$
      return text;
    }
    return ""; //$NON-NLS-1$
  }
View Full Code Here

   * @return the result of invocation of Widget#getToolTipText()
   * @since 1.0
   */
  public static String getToolTipText(final Object obj) {
    if ((obj instanceof Widget) && !((Widget) obj).isDisposed()) {
      Widget widget = (Widget) obj;
      return UIThreadRunnable.syncExec(widget.getDisplay(), new ReflectionInvoker(obj, "getToolTipText")); //$NON-NLS-1$
    }
    return ""; //$NON-NLS-1$
  }
View Full Code Here

TOP

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

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.