Java Code Examples for org.eclipse.swt.SWT#MouseHover

The following examples show how to use org.eclipse.swt.SWT#MouseHover . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public void handleEvent(Event event) {
	switch (event.type) {
		case SWT.MouseHover: {
			handleHover(new Point(event.x, event.y));
			break;
		}

		case SWT.Dispose:
			if (mainShell != null && !mainShell.isDisposed()) {
				mainShell.removeListener(SWT.Deactivate, this);
			}
			// fall through

		default:
			if (toolTipShell != null) {
				toolTipShell.dispose();
				toolTipShell = null;
				toolTipLabel = null;
			}
			break;
	} // switch
}
 
Example 2
@Override
public void handleEvent(Event event) {
  if (event.widget == addButton) {
    handleAdd();
  } else if (event.widget == removeButton
          || (event.type == SWT.KeyUp && event.character == SWT.DEL)) {
    handleRemove();
  } else if (event.widget == editButton || event.type == SWT.MouseDoubleClick) {
    handleEdit();
  }
  // else if (event.type == SWT.MouseDown && event.button == 3) {
  // handleTableContextMenuRequest(event);
  // }
  else if (event.type == SWT.MouseHover) {
    handleTableHoverHelp(event);
  } else if (event.type == SWT.Selection) {
    editor.getResourcesPage().getResourceBindingsSection().enable();
  }
  enable();
}
 
Example 3
Source Project: uima-uimaj   File: ImportSection.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void handleEvent(Event event) {

  if (event.widget == addButton) {
    handleAdd();
  } else if (event.widget == removeButton) {
    handleRemove();
  } else if (event.widget == setDataPathButton) {
    handleSetDataPath();
  } else if (event.type == SWT.MouseDown && event.button == 3) {
    handleTableContextMenuRequest(event);
  } else if (event.type == SWT.MouseHover && !bDisableToolTipHelp) {
    handleTableHoverHelp(event);
  } else if (event.type == SWT.KeyUp) {
    if (event.character == SWT.DEL) {
      handleRemove();
    }
  } else if (event.widget == importTable && event.type == SWT.Selection) {
    enable();
  }
}
 
Example 4
Source Project: gama   File: FlatButton.java    License: GNU General Public License v3.0 5 votes vote down vote up
@Override
public void handleEvent(final Event e) {
	switch (e.type) {
		case SWT.MouseExit:
			doHover(false);
			break;
		case SWT.MouseMove:
			break;
		case SWT.MouseEnter:
		case SWT.MouseHover:
			doHover(true);
			e.doit = true;
			break;
		case SWT.MouseUp:
			if (e.button == 1 && getClientArea().contains(e.x, e.y)) {
				doButtonUp();
			}
			break;
		case SWT.MouseDown:
			if (e.button == 1 && getClientArea().contains(e.x, e.y)) {
				doButtonDown();
			}
			break;
		default:
			;
	}
}
 
Example 5
/**
 * 
 */
public void show() {
	Event event = new Event();
	event.type = SWT.MouseHover;
	tableListener.handleEvent(event);
	show = true;
}
 
Example 6
@Override
public void handleEvent(Event event) {
  if (event.type == SWT.MouseHover) {
    showDescriptionAsToolTip(event);
  } else if (event.type == SWT.MouseDoubleClick) {
    addOverrides(0 != (event.stateMask & SWT.SHIFT));
  } else if (event.widget == createOverrideButton) {
    addOverrides(false);
  } else if (event.widget == createNonSharedOverrideButton) {
    addOverrides(true);
  }
}
 
Example 7
Source Project: uima-uimaj   File: AggregateSection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void handleEvent(Event event) {
  if (event.widget == addButton)
    handleAdd();
  else if (event.widget == removeButton
          || (event.type == SWT.KeyUp && event.character == SWT.DEL))
    handleRemove();
  else if (event.widget == addToFlowButton)
    handleAddToFlow();
  else if (event.widget == removeFromFlowButton)
    handleRemoveFromFlow();
  else if (event.widget == addRemoteButton)
    handleAddRemote();
  else if (event.widget == findAnalysisEngineButton)
    handleFindAnalysisEngine();

  // actions on table
  else if (event.widget == filesTable) {
    if (event.type == SWT.Selection) {
      // if no delegate is selected disable edit and remove
      boolean bEnableButtons = (filesTable.getSelectionCount() > 0);
      removeButton.setEnabled(bEnableButtons);
      addToFlowButton.setEnabled(bEnableButtons);
    } else if (event.type == SWT.MouseDown && 
                (event.button == 3  || 
                        // this is for Macintosh - they just have one button
                 (event.button == 1 && (0 != (event.stateMask & SWT.CTRL))))) {
      handleTableContextMenuRequest(event);
    } else if (event.type == SWT.MouseHover && !bDisableToolTipHelp) {
      handleTableHoverHelp(event);
    } 
    // Don't need this. Next mouse hover kills tool tip anyway
    // else if (event.type == SWT.MouseMove) {
    // filesTable.setToolTipText("");
    // }
  }
}
 
Example 8
Source Project: uima-uimaj   File: TypeSection.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void handleEvent(Event event) {
  if (event.widget == addTypeButton) {
    handleAddType();
  } else if (event.widget == addButton) {
    TreeItem parent = tt.getSelection()[0];
    if (null != parent.getParentItem())
      parent = parent.getParentItem();

    if (isSubtypeOfString(parent))
      handleAddAllowedValue(parent);
    else
      handleAddFeature(parent);

  } else if (event.widget == editButton) {
    handleEdit();
  } else if (event.type == SWT.MouseDoubleClick && (!isAggregate()) && // can't edit aggregates
          isLocalItem(tt.getSelection()[0])) {
    handleEdit();
  } else if (event.widget == removeButton) {
    handleRemove();
  } else if (event.widget == exportButton) {
    editor.getTypePage().getTypeImportSection().exportImportablePart("<typeSystemDescription>",
            TypeSystemNewWizard.TYPESYSTEM_TEMPLATE);
    refresh();
  } else if (event.widget == jcasGenButton) {
    editor.doJCasGenChkSrc(null);
  } else if (event.widget == limitJCasGenToProjectScope) {
    editor.setLimitJCasGenToProjectScope(limitJCasGenToProjectScope.getSelection());
  } else if (event.type == SWT.MouseHover) {
    handleHover(event);
  }
  enable();
}
 
Example 9
@Override
public void handleEvent(Event event) {
  if (event.type == SWT.MouseHover) {
    showDescriptionAsToolTip(event);
  } else if (event.widget == tree && event.type == SWT.Selection) {
    editor.getSettingsPage().getValueSection().refresh();
  }
}