org.eclipse.ui.texteditor.ChainedPreferenceStore#org.eclipse.swt.graphics.Cursor源码实例Demo

下面列出了org.eclipse.ui.texteditor.ChainedPreferenceStore#org.eclipse.swt.graphics.Cursor 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pentaho-kettle   文件: ValidatorDialog.java
private void getFields() {
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  shell.setCursor( busy );

  try {
    String sourceStepName = wSourceStep.getText();
    if ( !Utils.isEmpty( sourceStepName ) ) {
      String fieldName = wSourceField.getText();
      RowMetaInterface r = transMeta.getStepFields( sourceStepName );
      if ( r != null ) {
        wSourceField.setItems( r.getFieldNames() );
      }
      wSourceField.setText( fieldName );
    }
    shell.setCursor( null );
    busy.dispose();
  } catch ( KettleException ke ) {
    shell.setCursor( null );
    busy.dispose();
    new ErrorDialog(
      shell, BaseMessages.getString( PKG, "ValidatorDialog.FailedToGetFields.DialogTitle" ), BaseMessages
        .getString( PKG, "ValidatorDialog.FailedToGetFields.DialogMessage" ), ke );
  }
}
 
源代码2 项目: nebula   文件: XYGraphMediaFactory.java
/**
 * Private constructor to avoid instantiation.
 */
private XYGraphMediaFactory() {
	_colorRegistry = new ColorRegistry();
	_imageRegistry = new ImageRegistry();
	_fontRegistry = new FontRegistry();
	cursorRegistry = new HashMap<String, Cursor>();
	_imageCache = new HashMap<ImageDescriptor, Image>();

	// dispose all images from the image cache, when the display is disposed
	Display.getDefault().addListener(SWT.Dispose, new Listener() {
		public void handleEvent(final Event event) {
			for (Image img : _imageCache.values()) {
				img.dispose();
			}
			disposeResources();
		}
	});

}
 
源代码3 项目: AppleCommander   文件: Sleak.java
void refreshLabel () {
	int colors = 0, cursors = 0, fonts = 0, gcs = 0, images = 0, regions = 0;
	for (int i=0; i<objects.length; i++) {
		Object object = objects [i];
		if (object instanceof Color) colors++;
		if (object instanceof Cursor) cursors++;
		if (object instanceof Font) fonts++;
		if (object instanceof GC) gcs++;
		if (object instanceof Image) images++;
		if (object instanceof Region) regions++;
	}
	String string = ""; //$NON-NLS-1$
	if (colors != 0) string += colors + " Color(s)\n"; //$NON-NLS-1$
	if (cursors != 0) string += cursors + " Cursor(s)\n"; //$NON-NLS-1$
	if (fonts != 0) string += fonts + " Font(s)\n"; //$NON-NLS-1$
	if (gcs != 0) string += gcs + " GC(s)\n"; //$NON-NLS-1$
	if (images != 0) string += images + " Image(s)\n"; //$NON-NLS-1$
	if (regions != 0) string += regions + " Region(s)\n"; //$NON-NLS-1$
	if (string.length () != 0) {
		string = string.substring (0, string.length () - 1);
	}
	label.setText (string);
}
 
源代码4 项目: statecharts   文件: StatechartDefinitionSection.java
protected Label createSwitchControl() {
	Label switchControl = new Label(this, SWT.PUSH);
	switchControl.setToolTipText(sectionExpanded ? HIDE_SECTION_TOOLTIP : SHOW_SECTION_TOOLTIP);
	switchControl.setImage(sectionExpanded ? StatechartImages.COLLAPSE.image() : StatechartImages.EXPAND.image());
	switchControl.setCursor(new Cursor(getDisplay(), SWT.CURSOR_HAND));
	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(-1, -1).hint(MIN_SIZE[0], MIN_SIZE[1])
	.applyTo(switchControl);
	mouseListener = new MouseAdapter() {
		@Override
		public void mouseUp(MouseEvent e) {
			toggleExpandState();
		}
	};
	switchControl.addMouseListener(mouseListener);
	return switchControl;
}
 
源代码5 项目: birt   文件: ReportNonResizableHandleKit.java
/**
 * Fills the given List with handles at each corner of a figure.
 * 
 * @param part
 *            the handles' GraphicalEditPart
 * @param handles
 *            the List to add the four corner handles to
 * @param tracker
 *            the handles' DragTracker
 * @param cursor
 *            the handles' Cursor
 */
public static void addCornerHandles( GraphicalEditPart part, List handles,
		DragTracker tracker, Cursor cursor )
{
	handles.add( createHandle( part,
			PositionConstants.SOUTH_EAST,
			tracker,
			cursor ) );
	handles.add( createHandle( part,
			PositionConstants.SOUTH_WEST,
			tracker,
			cursor ) );
	handles.add( createHandle( part,
			PositionConstants.NORTH_WEST,
			tracker,
			cursor ) );
	handles.add( createHandle( part,
			PositionConstants.NORTH_EAST,
			tracker,
			cursor ) );
}
 
源代码6 项目: XPagesExtensionLibrary   文件: AlwStartPage.java
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);
}
 
源代码7 项目: Rel   文件: DbTab.java
private void showRecentlyUsedList() {
	boolean existing = true;
	if (contentRecent == null) {
		existing = false;
		Cursor oldCursor = getParent().getCursor();
		getParent().setCursor(new Cursor(getParent().getDisplay(), SWT.CURSOR_WAIT));
		try {
			contentRecent = new DbTabContentRecent(DbTab.this, modeContent);
		} finally {
			getParent().getCursor().dispose();
			getParent().setCursor(oldCursor);
		}			
	}
	contentStack.topControl = contentRecent;
	modeContent.layout();
	if (existing)
		contentRecent.redisplayed();
}
 
源代码8 项目: Rel   文件: DbTab.java
private void showRel() {
	boolean existing = true;
	if (contentRel == null) {
		existing = false;
		Cursor oldCursor = getParent().getCursor();
		getParent().setCursor(new Cursor(getParent().getDisplay(), SWT.CURSOR_WAIT));
		try {
			contentRel = new DbTabContentRel(DbTab.this, modeContent);
		} finally {
			getParent().getCursor().dispose();
			getParent().setCursor(oldCursor);
		}
	}
	contentStack.topControl = contentRel;
	modeContent.layout();
	if (existing)
		contentRel.redisplayed();
	contentRel.activateMenu();
}
 
源代码9 项目: Rel   文件: DbTab.java
private void showRev() {
	boolean existing = true;
	if (contentRev == null) {
		existing = false;
		Cursor oldCursor = getParent().getCursor();
		getParent().setCursor(new Cursor(getParent().getDisplay(), SWT.CURSOR_WAIT));
		try {
			contentRev = new DbTabContentRev(DbTab.this, modeContent);
		} finally {
			getParent().getCursor().dispose();
			getParent().setCursor(oldCursor);
		}
	}
	contentStack.topControl = contentRev;
	modeContent.layout();
	if (existing)
		contentRev.redisplayed();
}
 
源代码10 项目: Rel   文件: DbTab.java
private void showCmd() {
	boolean existing = true;
	if (contentCmd == null) {
		existing = false;
		Cursor oldCursor = getParent().getCursor();
		getParent().setCursor(new Cursor(getParent().getDisplay(), SWT.CURSOR_WAIT));
		try {
			contentCmd = new DbTabContentCmd(DbTab.this, modeContent);
			getParent().getCursor().dispose();
			getParent().setCursor(oldCursor);
		} catch (Exception e) {
			getParent().getCursor().dispose();
			getParent().setCursor(oldCursor);
			e.printStackTrace();
			MessageDialog.openError(Core.getShell(), "Unable to open local database",
					wrapped("Unable to open command line due to error: " + e.toString()));
			return;
		}
	}
	contentStack.topControl = contentCmd;
	modeContent.layout();
	if (existing)
		contentCmd.redisplayed();
}
 
源代码11 项目: Rel   文件: DbTab.java
/** Open a connection and associated panel. */
private boolean openConnection(String dbURL, boolean permanent, boolean canCreate) {
	Cursor oldCursor = getParent().getCursor();
	getParent().setCursor(new Cursor(getParent().getDisplay(), SWT.CURSOR_WAIT));
	try {
		setText(dbURL);
		if (!DBrowser.hasLocalRel() && dbURL.startsWith("db:")) {
			doConnectionResultFailed(new Throwable("Local Rel server is not installed."), dbURL);
			return false;
		}
		connection = attemptConnectionOpen(dbURL, canCreate);
		if (connection.client != null) {
			doConnectionResultSuccess(connection.client, dbURL, permanent);
			return true;
		} else {
			doConnectionResultFailed(connection.exception, dbURL);
			return false;
		}
	} finally {
		getParent().getCursor().dispose();
		getParent().setCursor(oldCursor);
	}
}
 
源代码12 项目: hop   文件: ValidatorDialog.java
private void getTransforms() {
  Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT );
  shell.setCursor( busy );

  String fieldTransform = wSourceTransform.getText();

  wSourceTransform.removeAll();
  wSourceTransform.setItems( pipelineMeta.getPrevTransformNames( transformMeta ) );

  wSourceTransform.setText( fieldTransform );

  shell.setCursor( null );
  busy.dispose();
}
 
源代码13 项目: nebula   文件: CursorCache.java
/**
 * Returns a cursor that is also cached as to not create more handles for each time the cursor type is fetched.
 *
 * @param type Cursor Type to fetch
 * @return Cursor
 */
public static Cursor getCursor(int type) {
    if (map.get(new Integer(type)) != null) {
        return map.get(new Integer(type));
    } else {
        Cursor c = new Cursor(Display.getDefault(), type);
        map.put(new Integer(type), c);
        return c;
    }
}
 
源代码14 项目: elexis-3-core   文件: SWTResourceManager.java
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
源代码15 项目: nebula   文件: XYGraphMediaFactory.java
public void disposeResources() {

		if (cursorRegistry != null) {
			for (Cursor cursor : cursorRegistry.values()) {
				if (cursor != null && !cursor.isDisposed())
					cursor.dispose();
			}
			cursorRegistry.clear();
		}

	}
 
源代码16 项目: birt   文件: ReportResizableHandleKit.java
static Handle createHandle( GraphicalEditPart owner, int direction,
		DragTracker tracker, Cursor cursor )
{
	ReportResizeHandle handle = new ReportResizeHandle( owner, direction );
	handle.setDragTracker( tracker );
	handle.setCursor( cursor );
	return handle;
}
 
源代码17 项目: birt   文件: ColumnDragTracker.java
@Override
protected Cursor getDefaultCursor( )
{
	if (isCloneActive())
	{
		return Cursors.SIZEWE;
	}
	return super.getDefaultCursor( );
}
 
源代码18 项目: nebula   文件: GraphicsUtil.java
public static Cursor createCursor(Device device, ImageData imageData, int width, int height) {
	try {
		return Cursor.class.getConstructor(Device.class, ImageData.class, int.class, int.class).newInstance(device,
				imageData, width, height);
	} catch (Exception ne) {
		return null;
	}
}
 
源代码19 项目: nebula   文件: CursorCache.java
/**
 * Returns a cursor that is also cached as to not create more handles for each time the cursor type is fetched.
 * 
 * @param type Cursor Type to fetch
 * @return Cursor
 */
public static Cursor getCursor(final int type) {
    if (_cache.get(new Integer(type)) == null) {
        final Cursor cursor = new Cursor(Display.getDefault(), type);
        _cache.put(new Integer(type), cursor); // NOPMD
        return cursor;
    } else {
        return (Cursor) _cache.get(new Integer(type)); // NOPMD
    }
}
 
/**
 * if the drag is permitted, show the cursor.
 * 
 * Else if a drag is occuring show it too, or show the 
 * no cursor.
 */
protected Cursor getDefaultCursor() {
	if (isMoveValid()) {
		return SharedCursors.SIZENS;
	} else {
		if (getState() == STATE_DRAG_IN_PROGRESS) {
			return SharedCursors.SIZENS;
		} 
		return SharedCursors.ARROW;
	}
}
 
源代码21 项目: BiglyBT   文件: SWTSkinTabSet.java
private void setActiveTab(final SWTSkinObjectTab newTab, final boolean evenIfSame) {
	Utils.execSWTThread(new AERunnable() {
		@Override
		public void runSupport() {
			Composite shell = skin.getShell();
			Cursor cursor = shell.getCursor();
			try {
				shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));
				swtSetActiveTab(newTab, evenIfSame);
			} finally {
				shell.setCursor(cursor);
			}
		}
	});
}
 
源代码22 项目: scava   文件: SWTResourceManager.java
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
源代码23 项目: WebpifyYourAndroidApp   文件: SWTResourceManager.java
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
源代码24 项目: logbook   文件: SWTResourceManager.java
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}
 
/**
 * if the drag is permitted, show the cursor.
 * 
 * Else if a drag is occuring show it too, or show the 
 * no cursor.
 */
protected Cursor getDefaultCursor() {
	if (isMoveValid()) {
		return SharedCursors.SIZEWE;
	} else {
		if (getState() == STATE_DRAG_IN_PROGRESS) {
			return SharedCursors.SIZEWE;
		} 
		return SharedCursors.ARROW;
	}
}
 
源代码26 项目: tracecompass   文件: TimeGraphControl.java
private void updateCursor(int x, int stateMask) {
    // if Wait cursor not active, check for the need to change the cursor
    if (getCursor() == fWaitCursor) {
        return;
    }
    Cursor cursor = null;
    if (fDragState == DRAG_SPLIT_LINE) {
    } else if (fDragState == DRAG_SELECTION) {
        cursor = fResizeCursor;
    } else if (fDragState == DRAG_TRACE_ITEM) {
        cursor = fDragCursor;
    } else if (fDragState == DRAG_ZOOM) {
        cursor = fZoomCursor;
    } else if ((stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
        cursor = fDragCursor;
    } else if ((stateMask & SWT.MODIFIER_MASK) == SWT.SHIFT) {
        cursor = fResizeCursor;
    } else if (!isOverSplitLine(x)) {
        long selectionBegin = fTimeProvider.getSelectionBegin();
        long selectionEnd = fTimeProvider.getSelectionEnd();
        int xBegin = getXForTime(selectionBegin);
        int xEnd = getXForTime(selectionEnd);
        if (Math.abs(x - xBegin) < SNAP_WIDTH || Math.abs(x - xEnd) < SNAP_WIDTH) {
            cursor = fResizeCursor;
        }
    }
    if (getCursor() != cursor) {
        setCursor(cursor);
    }
}
 
源代码27 项目: Pydev   文件: CopiedOverviewRuler.java
/**
 * Handles mouse moves.
 *
 * @param event the mouse move event
 */
protected void handleMouseMove(MouseEvent event) {
    if (fTextViewer != null) {
        int[] lines = toLineNumbers(event.y);
        Position p = getAnnotationPosition(lines);
        Cursor cursor = (p != null ? fHitDetectionCursor : null);
        if (cursor != fLastCursor) {
            fCanvas.setCursor(cursor);
            fLastCursor = cursor;
        }
    }
}
 
源代码28 项目: swt-bling   文件: ResourceQueryTest.java
@Test
public void getResources_Create4Cursors_CountEquals4() {
  Map<String, Integer> counts = ResourceQuery.getAllocatedResourceCounts(display);
  for (int i = 0; i < 4; i++) {
    new Cursor(display, i);
  }
  Assert.assertEquals(4, ResourceQuery.getAllocatedResourceCounts(display).get(Cursor.class.getName()).intValue());
}
 
源代码29 项目: ldparteditor   文件: SWTResourceManager.java
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
    for (Cursor cursor : m_idToCursorMap.values()) {
        cursor.dispose();
    }
    m_idToCursorMap.clear();
}
 
源代码30 项目: APICloud-Studio   文件: SWTResourceManager.java
/**
 * Dispose all of the cached cursors.
 */
public static void disposeCursors() {
	for (Cursor cursor : m_idToCursorMap.values()) {
		cursor.dispose();
	}
	m_idToCursorMap.clear();
}