use of org.eclipse.ui.progress.IProgressService in project netxms by netxms.
the class Activator method start.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
IProgressService service = PlatformUI.getWorkbench().getProgressService();
// $NON-NLS-1$
service.registerIconForFamily(getImageDescriptor("icons/event_configurator.png"), EventConfigurator.JOB_FAMILY);
}
use of org.eclipse.ui.progress.IProgressService in project netxms by netxms.
the class Activator method start.
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
// Register icon for our jobs
IProgressService service = PlatformUI.getWorkbench().getProgressService();
// $NON-NLS-1$
service.registerIconForFamily(getImageDescriptor("icons/log_viewer_job.png"), LogViewer.JOB_FAMILY);
}
use of org.eclipse.ui.progress.IProgressService in project netxms by netxms.
the class ObjectToolsAdapterFactory method getAdapter.
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject.getClass() != ObjectTool.class)
return null;
// Adapt to tool details
if (adapterType == ObjectToolDetails.class) {
final long toolId = ((ObjectTool) adaptableObject).getId();
ObjectToolDetails details = cache.get(toolId);
if (details == null) {
ToolDetailLoader job = new ToolDetailLoader(toolId, PlatformUI.getWorkbench().getDisplay());
IProgressService service = PlatformUI.getWorkbench().getProgressService();
try {
service.busyCursorWhile(job);
details = job.getResult();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return details;
}
// Adapt to IWorkbenchAdapter
if (adapterType == IWorkbenchAdapter.class) {
return new IWorkbenchAdapter() {
@Override
public Object getParent(Object o) {
return null;
}
@Override
public String getLabel(Object o) {
return ((ObjectTool) o).getDisplayName();
}
@Override
public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
@Override
public Object[] getChildren(Object o) {
return null;
}
};
}
return null;
}
use of org.eclipse.ui.progress.IProgressService in project liferay-ide by liferay.
the class CompileAction method run.
@Override
public void run() {
final ISelection selection = getSelectionProjects();
if ((selection != null) && selection instanceof IStructuredSelection) {
Object[] projects = ((IStructuredSelection) selection).toArray();
try {
SDK sdk = SDKUtil.getWorkspaceSDK();
IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
progressService.busyCursorWhile(new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
for (Object project : projects) {
if (project instanceof IProject) {
IProject p = (IProject) project;
sdk.war(p, null, false, monitor);
IDocument document = ((ProcessConsole) getConsole(p.getName())).getDocument();
if (document.get().contains("BUILD FAILED")) {
return;
}
}
}
}
});
} catch (Exception e) {
}
}
}
use of org.eclipse.ui.progress.IProgressService in project xtext-eclipse by eclipse.
the class JdtReferenceFinder method performNewSearch.
protected void performNewSearch(String label, Iterable<? extends IJavaElement> elements) throws JavaModelException, InterruptedException {
CompositeSearchQuery compositeSearchQuery = createCompositeQuery(label, elements);
if (compositeSearchQuery.canRunInBackground()) {
SearchUtil.runQueryInBackground(compositeSearchQuery);
} else {
IProgressService progressService = PlatformUI.getWorkbench().getProgressService();
IStatus status = SearchUtil.runQueryInForeground(progressService, compositeSearchQuery);
if (status.matches(IStatus.ERROR | IStatus.INFO | IStatus.WARNING)) {
ErrorDialog.openError(getShell(), SearchMessages.Search_Error_search_title, SearchMessages.Search_Error_search_message, status);
}
}
}
Aggregations