I want to disable the stop button of IProgressMonitor in progress view of an RCP application.
Consider implementing your own extension of org.eclipse.jface.dialogs.ProgressMonitorDialog instead, which has a method setCancelable(boolean).
Related
I am currently working on a web browser application using Eclipse e4.
I want to put on the toolbar a toggle button for saving my favorites url's.
I want it to be like in Google Chrome , a star which gets the yellow color when it's pressed(the link was added to favorites).
How can I do this?
Should I use for this the Application.e4xmi ?
You can use the Application.e4xmi if this is a tool bar for a Window or a Part. You would use a 'Handled Tool Item' in the tool bar.
The Application.e4xmi does not provide a way to set separate icons for the selected and normal states of a tool item so you will have to do this in the handler class. Something like:
#Execute
public void execute(MToolItem mitem)
{
if (mitem.isSelected())
mitem.setIconURI("platform:/plugin/your.plugin.id/icons/selectedimage.png");
else
mitem.setIconURI("platform:/plugin/your.plugin.id/icons/unselectedimage.png");
// TODO other code
}
Hi I am new to Eclipse rcp. I am developing a small application. In this application I want to show property view corressponding to the selected file.
I referred to this article : http://www.eclipse.org/articles/article.php?file=Article-Adapters/index.html
However, I am unable to find how to create property view and show it in my application perspective. Like shown here: http://www.eclipsepluginsite.com/properties-2.html
So, instead of eclipse application , it should be my application , my navigator view and my property view.
The Properties view has the id org.eclipse.ui.views.PropertySheet, there is a constant for this value IPageLayout.ID_PROP_SHEET.
So if you are using a Perspective factory for your RCP then you need to do an addView for IPageLayout.ID_PROP_SHEET to the main IPageLayout or an IFolderLayout.
I want to add a progressbar to my RCP e4 application that only indicates that some bg-work is running. No progress report needed, just a rolling bar like below:
My question is how to do that? Do I need to implement this control myself? Thanks a lot!
At the lowest level you can use the SWT ProgressBar control with the SWT.INDETERMINATE flag.
JFace extends this with the ProgressIndicator class which supports both determinate and indeterminate bars. It extends this further with the ProgressMonitorPart which provides a cancel button and implements the IProgressMonitorWithBlocking interface.
If you are using Job in e4 you need to hook up the UI progress bar to the job manager by setting the progress provider using:
Job.getJobManager().setProgressProvider(provider);
where provider is a class extending ProgressProvider. This class provides the job system with the progress monitor to use when jobs are running. This can be based on a ProgressMonitorPart.
I am creating a RCP in Eclipse Indigo 3.7. I want an editor-view link just like Adobe Flash Builder Design editor and view properties field i.e on opening an editor, its related view should also open without changing perspective and on closing editor, view should dispose.
I tried placing placeholders for views in editor but had no luck.
Also tried adding listener to view part but didn't got satisfactory response.
Please help me with your response.
A code snippet will also be helpful..
Thank you in advance.
I have not tested this, but...
In createPartControl(...) you should call IWorkbenchPage.showView(String viewId, String secondaryId, int mode) and in dispose() you should call IWorkbenchPage.hideView(IViewPart view). The later viewPart is the return value from showView(...).
I have a plug-in to an Eclipse RCP application that has a view. After an event occurs in the RCP application, the plug-in is instantiated, its methods are called to populate the plug-in's model, but I cannot find how to make the view appear without going to the "Show View..." menu.
I would think that there would be something in the workbench singleton that could handle this, but I have not found out how anywhere.
You are probably looking for this:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("viewId");
If called from handler of a command
HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().showView(viewId);
would be better, as I know.
I found the need to bring the view to the front after it had been opened and pushed to the background. The activate method does the trick.
PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()
.getActivePage()
.activate(workbenchPartToActivate);
NOTE: The workbenchPartToActivate is an instance of IWorkbenchPart.
In e4, the EPartService is responsible for opening Parts. This can also be used to open e3 ViewParts. Instantiate the following class through your IEclipseContext, call the openPart-Method, and you should see the Eclipse internal browser view.
public class Opener {
#Inject
EPartService partService;
public void openPart() {
MPart part = partService.createPart("org.eclipse.ui.browser.view");
part.setLabel("Browser");
partService.showPart(part, PartState.ACTIVATE);
}
}
Here you can find an example of how this works together with your Application.e4xmi.