Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Widget


  void clearLegacyEditingSetup() {
    if (!getControl().isDisposed() && getCellEditors() != null) {
      int count = doGetColumnCount();

      for (int i = 0; i < count || i == 0; i++) {
        Widget owner = getColumnViewerOwner(i);
        if (owner != null && !owner.isDisposed()) {
          ViewerColumn column = (ViewerColumn) owner
              .getData(ViewerColumn.COLUMN_VIEWER_KEY);
          if (column != null) {
            EditingSupport e = column.getEditingSupport();
            // Ensure that only EditingSupports are wiped that are
            // setup
View Full Code Here


            void setSelection(Event e) {
                if (e == null) {
          return;
        }
                Widget w = e.widget;
                if (w.isDisposed()) {
          return;
        }

                SelectionEvent selEvent = new SelectionEvent(e);
View Full Code Here

    /* (non-Javadoc)
     * Method declared on ICheckable.
     */
    public boolean getChecked(Object element) {
        Widget widget = findItem(element);
        if (widget instanceof TableItem) {
            return ((TableItem) widget).getChecked();
        }
        return false;
    }
View Full Code Here

     * @param element the element
     * @return <code>true</code> if the element is grayed,
     *   and <code>false</code> if not grayed
     */
    public boolean getGrayed(Object element) {
        Widget widget = findItem(element);
        if (widget instanceof TableItem) {
            return ((TableItem) widget).getGrayed();
        }
        return false;
    }
View Full Code Here

    /* (non-Javadoc)
     * Method declared on ICheckable.
     */
    public boolean setChecked(Object element, boolean state) {
        Assert.isNotNull(element);
        Widget widget = findItem(element);
    if (widget instanceof TableItem) {
      TableItem item = (TableItem) widget;
      if (item.getChecked() != state)
        item.setChecked(state);
      return true;
View Full Code Here

     * @return <code>true</code> if the element is visible and the gray
     *  state could be set, and <code>false</code> otherwise
     */
    public boolean setGrayed(Object element, boolean state) {
        Assert.isNotNull(element);
        Widget widget = findItem(element);
    if (widget instanceof TableItem) {
      TableItem item = (TableItem) widget;
      if (item.getGrayed() != state)
        item.setGrayed(state);
      return true;
View Full Code Here

          switch (event.type) {
          case SWT.Dispose:
            handleWidgetDispose(event);
            break;
          case SWT.Selection:
            Widget ew = event.widget;
            if (ew != null) {
              handleWidgetSelection(event, ((Button) ew)
                  .getSelection());
            }
            break;
View Full Code Here

          switch (event.type) {
          case SWT.Dispose:
            handleWidgetDispose(event);
            break;
          case SWT.Selection:
            Widget ew = event.widget;
            if (ew != null) {
              handleWidgetSelection(event, ((MenuItem) ew)
                  .getSelection());
            }
            break;
View Full Code Here

          switch (event.type) {
          case SWT.Dispose:
            handleWidgetDispose(event);
            break;
          case SWT.Selection:
            Widget ew = event.widget;
            if (ew != null) {
              handleWidgetSelection(event, ((ToolItem) ew)
                  .getSelection());
            }
            break;
View Full Code Here

  /**
   * Handles a widget selection event.
   */
  private void handleWidgetSelection(Event e, boolean selection) {

    Widget item = e.widget;
    if (item != null) {
      int style = item.getStyle();

      if ((style & (SWT.TOGGLE | SWT.CHECK)) != 0) {
        if (action.getStyle() == IAction.AS_CHECK_BOX) {
          action.setChecked(selection);
        }
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.