本文整理汇总了Java中org.eclipse.ui.internal.WorkbenchPlugin.log方法的典型用法代码示例。如果您正苦于以下问题:Java WorkbenchPlugin.log方法的具体用法?Java WorkbenchPlugin.log怎么用?Java WorkbenchPlugin.log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.internal.WorkbenchPlugin
的用法示例。
在下文中一共展示了WorkbenchPlugin.log方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyBindingService
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
public IKeyBindingService getKeyBindingService() {
if (service == null) {
service = getMultiPageEditor().getEditorSite().getKeyBindingService();
if (service instanceof INestableKeyBindingService) {
INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
service = nestableService.getKeyBindingService(this);
} else {
/*
* This is an internal reference, and should not be copied by client code. If you are thinking of copying this,
* DON'T DO IT.
*/
WorkbenchPlugin
.log("MultiPageEditorSite.getKeyBindingService() Parent key binding service was not an instance of INestableKeyBindingService. It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
return service;
}
示例2: getWorkbenchErrorHandler
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
@Override
public synchronized AbstractStatusHandler getWorkbenchErrorHandler() {
return new WorkbenchErrorHandler() {
@Override
public void handle(StatusAdapter statusAdapter, int style) {
if (isClosing) {
// we are shutting down, so just log
WorkbenchPlugin.log(statusAdapter.getStatus());
return;
}
if ((style & StatusManager.SHOW) != 0) {
style = style | StatusManager.BLOCK;
}
super.handle(statusAdapter, style);
}
};
}
示例3: getColumnImage
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
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;
}
示例4: createCommand
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
/**
* Build a command from the executable extension information.
*
* @param commandService
* to get the Command object
* @param commandId
* the command id for this action
* @param parameterMap
*/
private void createCommand(ICommandService commandService,
String commandId, Map parameterMap) {
Command cmd = commandService.getCommand(commandId);
if (!cmd.isDefined()) {
WorkbenchPlugin.log("Command " + commandId + " is undefined"); //$NON-NLS-1$//$NON-NLS-2$
return;
}
if (parameterMap == null) {
parameterizedCommand = new ParameterizedCommand(cmd, null);
return;
}
parameterizedCommand = ParameterizedCommand.generateCommand(cmd,
parameterMap);
}
示例5: runWithEvent
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
public void runWithEvent(Event event) {
if (handlerService == null) {
String commandId = (parameterizedCommand == null ? "unknownCommand" //$NON-NLS-1$
: parameterizedCommand.getId());
WorkbenchPlugin.log("Cannot run " + commandId //$NON-NLS-1$
+ " before command action has been initialized"); //$NON-NLS-1$
return;
}
try {
if (parameterizedCommand != null) {
handlerService.executeCommand(parameterizedCommand, event);
}
} catch (Exception e) {
WorkbenchPlugin.log(e);
}
}
示例6: deactivateSite
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
/**
* This method can be used by implementors of {@link MultiPageEditorPart#createPageContainer(Composite)} to deactivate
* the active inner editor services while their header has focus. A deactivateSite() must have a matching call to
* activateSite() when appropriate.
* <p>
* An new inner editor will have its site activated on a {@link MultiPageEditorPart#pageChange(int)}.
* </p>
* <p>
* <b>Note:</b> This API is evolving in 3.4 and this might not be its final form.
* </p>
*
* @param immediate
* immediately deactivate the legacy keybinding service
* @param containerSiteActive
* Leave the page container site active.
* @since 3.4
* @see #activateSite()
* @see #createPageContainer(Composite)
* @see #getPageSite(int)
* @see #PAGE_CONTAINER_SITE
*/
protected final void deactivateSite(boolean immediate, boolean containerSiteActive) {
// Deactivate the nested services from the last active service locator.
if (activeServiceLocator != null) {
activeServiceLocator.deactivate();
activeServiceLocator = null;
}
final int pageIndex = getActivePage();
final IKeyBindingService service = getSite().getKeyBindingService();
if (pageIndex < 0 || pageIndex >= getPageCount() || immediate) {
// There is no selected page, so deactivate the active service.
if (service instanceof INestableKeyBindingService) {
final INestableKeyBindingService nestableService = (INestableKeyBindingService) service;
nestableService.activateKeyBindingService(null);
} else {
WorkbenchPlugin
.log("MultiPageEditorPart.deactivateSite() Parent key binding service was not an instance of INestableKeyBindingService. It was an instance of " + service.getClass().getName() + " instead."); //$NON-NLS-1$ //$NON-NLS-2$
}
}
if (containerSiteActive) {
IServiceLocator containerSite = getPageContainerSite();
if (containerSite instanceof INestable) {
activeServiceLocator = (INestable) containerSite;
activeServiceLocator.activate();
}
}
}
示例7: logPreferenceStoreException
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
/**
* 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);
}
示例8: firePropertyChange
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
/**
* Fires a property changed event.
*
* @param propertyId
* the id of the property that changed
*/
protected void firePropertyChange(final int propertyId) {
Object[] array = getListeners();
for (int nX = 0; nX < array.length; nX++) {
final IPropertyListener l = (IPropertyListener) array[nX];
try {
l.propertyChanged(WorkbenchPart.this, propertyId);
} catch (RuntimeException e) {
WorkbenchPlugin.log(e);
}
}
}
示例9: firePartPropertyChanged
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
/**
* @since 3.3
*/
protected void firePartPropertyChanged(String key, String oldValue,
String newValue) {
final PropertyChangeEvent event = new PropertyChangeEvent(this, key,
oldValue, newValue);
Object[] l = partChangeListeners.getListeners();
for (int i = 0; i < l.length; i++) {
try {
((IPropertyChangeListener) l[i]).propertyChange(event);
} catch (RuntimeException e) {
WorkbenchPlugin.log(e);
}
}
}
示例10: initPage
import org.eclipse.ui.internal.WorkbenchPlugin; //导入方法依赖的package包/类
/**
* Initializes the given page with a page site.
* <p>
* Subclasses should call this method after the page is created but before
* creating its controls.
* </p>
* <p>
* Subclasses may override
* </p>
*
* @param page
* The page to initialize
*/
protected void initPage(IPageBookViewPage page) {
try {
page.init(new PageSite(getViewSite()));
} catch (PartInitException e) {
WorkbenchPlugin.log(getClass(), "initPage", e); //$NON-NLS-1$
}
}