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

The following examples show how to use org.eclipse.swt.SWT#CURSOR_HAND . 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
Source File: SWTSkin.java    From BiglyBT with GNU General Public License v2.0 6 votes vote down vote up
protected static Listener getHandCursorListener(Display display) {
	if (handCursorListener == null) {
		handCursor = new Cursor(display, SWT.CURSOR_HAND);
		handCursorListener = new Listener() {
			@Override
			public void handleEvent(Event event) {
				if (event.type == SWT.MouseEnter) {
					((Control) event.widget).setCursor(handCursor);
				}
				if (event.type == SWT.MouseExit) {
					((Control) event.widget).setCursor(null);
				}
			}
		};
	}

	return handCursorListener;
}
 
Example 2
Source File: AlwStartPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
protected AlwStartPage() {
    super("");
    setTitle("Application Layout");             // $NLX-AlwStartPage.ApplicationLayout-1$
    setMessage("Choose the configuration for this control.", IMessageProvider.INFORMATION); // $NLX-AlwStartPage.Choosetheconfigurationforthiscont-1$

    // Setup the title font
    _titleFont = JFaceResources.getBannerFont();
    
    // Setup hand cursor
    _handCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_HAND);
    
    // Load images - Do not have to be disposed later - plugin maintains a list
    _defImage = ExtLibToolingPlugin.getImage("app_layout.jpg"); // $NON-NLS-1$
    if (_showResponsiveIcon) {
        _responsiveImage = NavigatorPlugin.getImage("navigatorIcons/navigatorChild.png"); // $NON-NLS-1$
    } else {
        _responsiveImage = null;
    }
    
    // Setup hyperlink color
    _hyperlinkColor = new Color(Display.getCurrent(), 0, 0, 255);
}
 
Example 3
Source File: ShowHelpDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private void setImages() {
  imageBackEnabled = GuiResource.getInstance().getImageBackEnabled();
  imageBackDisabled = GuiResource.getInstance().getImageBackDisabled();
  imageForwardEnabled = GuiResource.getInstance().getImageForwardEnabled();
  imageForwardDisabled = GuiResource.getInstance().getImageForwardDisabled();
  imageRefreshEnabled = GuiResource.getInstance().getImageRefreshEnabled();
  imageRefreshDisabled = GuiResource.getInstance().getImageRefreshDisabled();
  imageHomeEnabled = GuiResource.getInstance().getImageHomeEnabled();
  imageHomeDisabled = GuiResource.getInstance().getImageHomeDisabled();
  imagePrintEnabled = GuiResource.getInstance().getImagePrintEnabled();
  imagePrintDisabled = GuiResource.getInstance().getImagePrintDisabled();
  cursorEnabled = new Cursor( display, SWT.CURSOR_HAND );
  cursorDisabled = new Cursor( display, SWT.CURSOR_ARROW );
}
 
Example 4
Source File: SwtEventHandler.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * The constructor.
 * @param Interactive Renderer
 * @param swtRendererImpl 
 * 
 * @param _lhmAllTriggers
 * @param _jc
 * @param _lcl
 */
SwtEventHandler(InteractiveRenderer iv, LinkedHashMap<TriggerCondition, List<RegionAction>>  _lhmAllTriggers, IUpdateNotifier _jc,
		ULocale _lcl )
{

	lhmAllTriggers = _lhmAllTriggers;
	iun = _jc;
	lcl = _lcl;
	hand_cursor = new Cursor( Display.getDefault( ), SWT.CURSOR_HAND );
	_gc = new GC( Display.getDefault( ) );
	this.iv = iv;
	
}
 
Example 5
Source File: IndexEditionControl.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public IndexEditionControl(Section parent, AbstractBdmFormPage formPage, DataBindingContext ctx,
        IObservableValue<Index> selectedIndexObservable, IObservableList<Field> actualsFieldsObservable) {
    super(parent, SWT.NONE);
    formPage.getToolkit().adapt(this);
    setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    setLayout(GridLayoutFactory.fillDefaults().margins(15, 10).create());

    this.formPage = formPage;
    this.selectedIndexObservable = selectedIndexObservable;
    this.actualsFieldsObservable = actualsFieldsObservable;
    this.indexableFieldFilter = new IndexableFieldFilter();
    this.fieldStyleStringProvider = new FieldStyleStringProvider();
    this.cursorHand = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
    this.cursorArrow = new Cursor(parent.getDisplay(), SWT.CURSOR_ARROW);
    this.errorColor = new LocalResourceManager(JFaceResources.getResources(),
            parent).createColor(ColorConstants.ERROR_RGB);

    indexedFieldNameObservable = EMFObservables.observeDetailList(Realm.getDefault(), selectedIndexObservable,
            BusinessDataModelPackage.Literals.INDEX__FIELD_NAMES);
    indexedFieldsObservable = new WritableList<>();

    bindIndexedFieldObservableLists(ctx, actualsFieldsObservable);

    createLabels();

    Composite viewersComposite = formPage.getToolkit().createComposite(this);
    viewersComposite.setLayout(GridLayoutFactory.fillDefaults().extendedMargins(0, 0, 10, 0).numColumns(2).create());
    viewersComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    createAvailableAttributesTableViewer(viewersComposite);
    createIndexedAttributesTableViewer(viewersComposite);

    indexedFieldsObservable.addChangeListener(e -> availableAttributesTableViewer.refresh());
}
 
Example 6
Source File: ShowHelpDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private void setImages() {
  imageBackEnabled = GUIResource.getInstance().getImageBackEnabled();
  imageBackDisabled = GUIResource.getInstance().getImageBackDisabled();
  imageForwardEnabled = GUIResource.getInstance().getImageForwardEnabled();
  imageForwardDisabled = GUIResource.getInstance().getImageForwardDisabled();
  imageRefreshEnabled = GUIResource.getInstance().getImageRefreshEnabled();
  imageRefreshDisabled = GUIResource.getInstance().getImageRefreshDisabled();
  imageHomeEnabled = GUIResource.getInstance().getImageHomeEnabled();
  imageHomeDisabled = GUIResource.getInstance().getImageHomeDisabled();
  imagePrintEnabled = GUIResource.getInstance().getImagePrintEnabled();
  imagePrintDisabled = GUIResource.getInstance().getImagePrintDisabled();
  cursorEnabled = new Cursor( display, SWT.CURSOR_HAND );
}
 
Example 7
Source File: SVNHistoryPage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
public void createControl(Composite parent) {
  this.busyCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_WAIT);
  this.handCursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);

  this.showComments = store.getBoolean(ISVNUIConstants.PREF_SHOW_COMMENTS);
  this.wrapCommentsText = store.getBoolean(ISVNUIConstants.PREF_WRAP_COMMENTS);
  this.showAffectedPaths = store.getBoolean(ISVNUIConstants.PREF_SHOW_PATHS);

  this.svnHistoryPageControl = new SashForm(parent, SWT.VERTICAL);
  this.svnHistoryPageControl.setLayoutData(new GridData(GridData.FILL_BOTH));

  this.toggleAffectedPathsModeActions = new ToggleAffectedPathsOptionAction[] {
      new ToggleAffectedPathsOptionAction(this, "HistoryView.affectedPathsTableLayout",  //$NON-NLS-1$
          ISVNUIConstants.IMG_AFFECTED_PATHS_TABLE_MODE, 
          ISVNUIConstants.PREF_AFFECTED_PATHS_MODE, 
          ISVNUIConstants.MODE_FLAT),
      new ToggleAffectedPathsOptionAction(this, "HistoryView.affectedPathsFlatLayout",  //$NON-NLS-1$
          ISVNUIConstants.IMG_AFFECTED_PATHS_FLAT_MODE, 
          ISVNUIConstants.PREF_AFFECTED_PATHS_MODE, 
          ISVNUIConstants.MODE_FLAT2),
      new ToggleAffectedPathsOptionAction(this, "HistoryView.affectedPathsCompressedLayout",  //$NON-NLS-1$
          ISVNUIConstants.IMG_AFFECTED_PATHS_COMPRESSED_MODE, 
          ISVNUIConstants.PREF_AFFECTED_PATHS_MODE, 
          ISVNUIConstants.MODE_COMPRESSED),
    };
  
  this.toggleAffectedPathsLayoutActions = new ToggleAffectedPathsOptionAction[] {
      new ToggleAffectedPathsOptionAction(this, "HistoryView.affectedPathsHorizontalLayout",  //$NON-NLS-1$
          ISVNUIConstants.IMG_AFFECTED_PATHS_HORIZONTAL_LAYOUT, 
          ISVNUIConstants.PREF_AFFECTED_PATHS_LAYOUT, 
          ISVNUIConstants.LAYOUT_HORIZONTAL),
      new ToggleAffectedPathsOptionAction(this, "HistoryView.affectedPathsVerticalLayout",  //$NON-NLS-1$
          ISVNUIConstants.IMG_AFFECTED_PATHS_VERTICAL_LAYOUT, 
          ISVNUIConstants.PREF_AFFECTED_PATHS_LAYOUT, 
          ISVNUIConstants.LAYOUT_VERTICAL),
    };
  
  createTableHistory(svnHistoryPageControl);
  createAffectedPathsViewer();
  contributeActions();

  svnHistoryPageControl.setWeights(new int[] { 70, 30});

  // set F1 help
  // PlatformUI.getWorkbench().getHelpSystem().setHelp(svnHistoryPageControl,
  // IHelpContextIds.RESOURCE_HISTORY_VIEW);
  // initDragAndDrop();

  // add listener for editor page activation - this is to support editor
  // linking
  // getSite().getPage().addPartListener(partListener);
  // getSite().getPage().addPartListener(partListener2);
}