I've designed my own help content for my RCP. And the pop up help window works properly for other common dialog, except the Help->About Dialog.
My purpose is once the user clicked the help button, the help window should be popped up successfully just like what eclipse does.
I set an help listener for the aboutAction in my code. Unfortunately it does not work.
aboutAction = ActionFactory.ABOUT.create(getWindow());
WorkbenchHelpSystem.getInstance().setHelp(aboutAction, IWorkbenchHelpContextIds.HELP_CONTENTS_ACTION);
aboutAction.setImageDescriptor(IDEInternalWorkbenchImages.getImageDescriptor(IDEInternalWorkbenchImages.IMG_OBJS_DEFAULT_PROD));
aboutAction.setHelpListener(new HelpListener()
{
public void helpRequested(HelpEvent event)
{
getWindow().getWorkbench().getHelpSystem().displayHelp();
}
});
menu.add(aboutAction);
menu.add(new GroupMarker("group.about.ext"));
I am just a beginner in eclipse rcps. Could anyone give me some suggestions?
If you want to know how something is implemented in Eclipse (in your case the about dialog) you could use the Plug-in Spy. Look in this stackoverflow answer for further details on how to use the plug-in spy.
Related
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 am calling WizardDialog dialog = new WizardDialog and a new window is opening with a help icon in the bottom button tray in extreme left corner. I don't need that button.
How to remove that or is there any way to add help content to it.
According to bug 330206:
To hide the "?" you need to call setHelpAvailable(false) on your WizardDialog.
If you don't control/create the dialog, you can add the following method to
your wizard:
public void setContainer(IWizardContainer wizardContainer) {
super.setContainer(wizardContainer);
if (getContainer() instanceof TrayDialog)
((TrayDialog)getContainer()).setHelpAvailable(false);
}
To add Help, you can see the general idea in this thread, but take into account bug 3827:
if you are opening the wizard in a WizardDialog you create, you have to set help on the dialog's shell: ex.
dialog.create();
WorkbenchHelp.setHelp(dialog.getShell(), new Object[]{IHelpContextIds.NEW_WIZARD});
dialog.open();
HI,
I am facing some problem.. I want to hide the menu when eclipse workbench starts.
But the problem is menu is not hiding when the eclipse workbench starts. It is hiding only
when some refresh is happened. for example: when I change the default perspective to some other perspective, I am getting the desired out put. That means menu is hiding.
But when the eclipse workbench is loaded it is not hiding the menu. Below is my code.
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
try {
IWorkbenchWindow window = Workbench.getInstance().getActiveWorkbenchWindow()
if(window instanceof WorkbenchWindow) {
MenuManager menuManager = ((WorkbenchWindow)window).getMenuManager();
IContributionItem[] items = menuManager.getItems();
for(IContributionItem item:items){
System.out.println("item.getId()::: "+item.getId());
menuManager.remove("org.eclipse.ui.run");
menuManager.remove("help");
menuManager.remove("project");
}
}
}`
}
};
Given that you are looking to hide some features, I don't think that this is the best approach. (Not I am using the term feature here in the colloquial way, not as an Eclipse feature.
I would recommend one of two avenues:
Perspectives: See the extension point org.eclipse.ui.perspectives. This allows you to create a new perspective like the debug perspective or the Java perspective. Using a perspective, you can select exactly what menu items and views are shown and which ones are hidden.
Capabilities (aka activites): See the extension point org.eclipse.ui.activities. This allows you to have some fairly fine-grained control over what features are available in the workspace. See more info here: http://wiki.eclipse.org/Galileo_Capabilities
Put Your code in org.eclipse.ui.startup extention point. Make a Startup class after implementing the interface IStartup. For Details follow this link:-
Eclipse plugin : disable/enable dynamically an action from main menubar
I don't know RCP very well yet, but I've been reading a lot of the docs. I don't know if my question makes sense; I apologize if not and beg that you try to work out what I mean and come up with some kind of answer.
I have a tree view element, which has a double click listener on it. In another part of the window there is a layout folder which contains views that are supposed to be inspectors for the items double-clicked on.
The only way I know to make another inspector appear is:
getActivePage().showView(Inspector.ID).
showView() doesn't give any opportunity to pass extra information to the view, so can it know which element to inspect?
Pointers in different directions appreciated. The Vogel tutorial doesn't seem to cover this, or I don't understand it.
You could check if the article "Link to Editor" can help you here.
That is, instead of trying to access the right view, define a Listener for the Editors:
private IPartListener2 partListener2 = new IPartListener2() {
public void partActivated(IWorkbenchPartReference ref) {
if (ref.getPart(true) instanceof IEditorPart)
editorActivated(getViewSite().getPage().getActiveEditor());
}
That way, you can get back the right Editor, and ask that Editor all you need for your View to update accordingly.
You can use the SelectionService. The Inspector view should register as a SelectionListener. And the other view with the tree should register a SelectionProvider. This view should listen for the double click in the tree and then update the selection
My webpage submits information to a page and the response returns a popup window. Does anyone have an idea about how I can validate the information in the popup window?
Popup window doesn't have a WindowId and I'm not able to get hold of the popup window using selenium.GetWindow("popuwindowname"), selenium.GetWindow("title=something") or selenium.GetWindow("name=popupwindowname").
Has anyone had a similar problem and found a workaround or an alternative solution?
Can you put the html source of the popup window. Usually, what you see in the screen may different in the html code.
What type of popup dialog is returned if this is a modal dialog selenium does not handle modal dialogs.because a modal dialog stops all javascripts from running until it is closed.
see Selenium FAQ
Try this
public void testPopup() throws Exception {
selenium.open("http://yoursitename/page.aspx");
selenium.click("//img[#alt='Share']");
selenium.waitForPopUp("_blank", "30000");
selenium.selectPopUp("");
verifyTrue(selenium.isTextPresent("Recommend to a friend"));
selenium.close();
Hope will help you!