Java Code Examples for org.eclipse.ui.internal.WorkbenchPlugin#PI_WORKBENCH

The following examples show how to use org.eclipse.ui.internal.WorkbenchPlugin#PI_WORKBENCH . 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: FilteredItemsSelectionDialog.java    From tlaplus with MIT License 6 votes vote down vote up
protected IStatus run(IProgressMonitor monitor) {
	if (monitor.isCanceled()) {
		return new Status(IStatus.CANCEL, WorkbenchPlugin.PI_WORKBENCH,
				IStatus.CANCEL, EMPTY_STRING, null);
	}

	if (FilteredItemsSelectionDialog.this != null) {
		GranualProgressMonitor wrappedMonitor = new GranualProgressMonitor(
				monitor);
		FilteredItemsSelectionDialog.this.reloadCache(true,
				wrappedMonitor);
	}

	if (!monitor.isCanceled()) {
		refreshJob.schedule();
	}

	return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK,
			EMPTY_STRING, null);

}
 
Example 2
Source File: KeysPreferencePage.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
public Image getColumnImage(Object element, int index) {
	BindingElement be = (BindingElement) element;
	switch (index) {
	case COMMAND_NAME_COLUMN:
		final String commandId = be.getId();
		final ImageDescriptor imageDescriptor = commandImageService.getImageDescriptor(commandId);
		if (imageDescriptor == null) {
			return null;
		}
		try {
			return localResourceManager.createImage(imageDescriptor);
		} catch (final DeviceResourceException e) {
			final String message = "Problem retrieving image for a command '" //$NON-NLS-1$
					+ commandId + '\'';
			final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e);
			WorkbenchPlugin.log(message, status);
		}
		return null;
	}

	return null;
}
 
Example 3
Source File: KeysPreferencePage.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
public Image getColumnImage(Object element, int index) {
	BindingElement be = (BindingElement) element;
	switch (index) {
	case COMMAND_NAME_COLUMN:
		final String commandId = be.getId();
		final ImageDescriptor imageDescriptor = commandImageService.getImageDescriptor(commandId);
		if (imageDescriptor == null) {
			return null;
		}
		try {
			return localResourceManager.createImage(imageDescriptor);
		} catch (final DeviceResourceException e) {
			final String message = "Problem retrieving image for a command '" //$NON-NLS-1$
					+ commandId + '\'';
			final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e);
			WorkbenchPlugin.log(message, status);
		}
		return null;
	}

	return null;
}
 
Example 4
Source File: KeysPreferencePage.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
public Image getColumnImage(Object element, int index) {
	BindingElement be = (BindingElement) element;
	switch (index) {
	case COMMAND_NAME_COLUMN:
		final String commandId = be.getId();
		final ImageDescriptor imageDescriptor = commandImageService.getImageDescriptor(commandId);
		if (imageDescriptor == null) {
			return null;
		}
		try {
			return localResourceManager.createImage(imageDescriptor);
		} catch (final DeviceResourceException e) {
			final String message = "Problem retrieving image for a command '" //$NON-NLS-1$
					+ commandId + '\'';
			final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, message, e);
			WorkbenchPlugin.log(message, status);
		}
		return null;
	}

	return null;
}
 
Example 5
Source File: FilteredItemsSelectionDialog.java    From tlaplus with MIT License 5 votes vote down vote up
public IStatus runInUIThread(IProgressMonitor monitor) {
	if (monitor.isCanceled())
		return new Status(IStatus.OK, WorkbenchPlugin.PI_WORKBENCH,
				IStatus.OK, EMPTY_STRING, null);

	if (FilteredItemsSelectionDialog.this != null) {
		FilteredItemsSelectionDialog.this.refresh();
	}

	return new Status(IStatus.OK, PlatformUI.PLUGIN_ID, IStatus.OK,
			EMPTY_STRING, null);
}
 
Example 6
Source File: KeyController2.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Logs the given exception, and opens an error dialog saying that something went wrong. The exception is assumed to
 * have something to do with the preference store.
 * @param exception
 *            The exception to be logged; must not be <code>null</code>.
 */
private final void logPreferenceStoreException(final Throwable exception) {
	final String message = NewKeysPreferenceMessages.PreferenceStoreError_Message;
	String exceptionMessage = exception.getMessage();
	if (exceptionMessage == null) {
		exceptionMessage = message;
	}
	final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, exceptionMessage, exception);
	WorkbenchPlugin.log(message, status);
	StatusUtil.handleStatus(message, exception, StatusManager.SHOW);
}
 
Example 7
Source File: KeyController2.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Logs the given exception, and opens an error dialog saying that something went wrong. The exception is assumed to
 * have something to do with the preference store.
 * @param exception
 *            The exception to be logged; must not be <code>null</code>.
 */
private final void logPreferenceStoreException(final Throwable exception) {
	final String message = NewKeysPreferenceMessages.PreferenceStoreError_Message;
	String exceptionMessage = exception.getMessage();
	if (exceptionMessage == null) {
		exceptionMessage = message;
	}
	final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, exceptionMessage, exception);
	WorkbenchPlugin.log(message, status);
	StatusUtil.handleStatus(message, exception, StatusManager.SHOW);
}
 
Example 8
Source File: KeyController2.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Logs the given exception, and opens an error dialog saying that something went wrong. The exception is assumed to
 * have something to do with the preference store.
 * @param exception
 *            The exception to be logged; must not be <code>null</code>.
 */
private final void logPreferenceStoreException(final Throwable exception) {
	final String message = NewKeysPreferenceMessages.PreferenceStoreError_Message;
	String exceptionMessage = exception.getMessage();
	if (exceptionMessage == null) {
		exceptionMessage = message;
	}
	final IStatus status = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, 0, exceptionMessage, exception);
	WorkbenchPlugin.log(message, status);
	StatusUtil.handleStatus(message, exception, StatusManager.SHOW);
}