Eclipse RCP setselectionprovider not working - java

I am using the following code to set the selection provider outside the createpartcontrol method of the view, my project view is restricted wherein the createpartcontrol is a generic and I will not be able to use the selection provider inside it. The following code does not work with enabling menu by property testers where in I am using <enabled when> variable="selection" </enabled when> when the view loads initially but when click outside the view and click backed into the view then property testers works fine and my menu items get enabled.
Also I found this post in the eclipse documentation that Replacing the selection provider during the lifetime of the part is not properly supported by the workbench :
https://eclipse.org/articles/Article-WorkbenchSelections/article.html
Not sure where am i going wrong? Could someone provide some help with respect to this.
Also when i debug through eclipse it goes through this part of the code and everything works fine , but when run as an application outside debug mode the issue occurs.
IWorkbenchWindow iw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
iw.getActivePage().getActivePart().getSite().setSelectionProvider(objectComposite.getViewer());

Related

How can you force eclipse to perform createPartControl() on a stacked view

I have a view that is stacked behind another view on creation. It is supposed to listen for an event and bring itself to the front and populate some data if that data gets set.
However becasue the createPartControl method doesn't get called until the user actually brings it to the front the functionality doesn't work how I'd like,
Is there a way to tell the rcp application that it should instantiate that view on load up?
Assuming you're working with Indigo or Juno and you're developing an RCP application, have you tried one of the methods available on IWorkbenchPage (like activate(…) or showView(…)) ? Basically, knowing your view ID (as defined in the plugin.xml), you can add this code to the postWindowOpen() method of your application WorkbenchWindowAdvisor, so that it is called once the window is opened.

RCP Application coundn't find new added view

I am using Eclipse Juno for RCP RAP developer. I have created a Plug-in Project with a single view and it runs normally. But whenever I tried to add a new view into that workbench, the window dosent update. Also if I change the id of the current view, it also not working. And if I delete the current view, it also showing it. As a whole, the view part is not updating of the application. Anybody knows any answer ?
Your changes doesn't get applied correctly.
Eclipse 4 persists certain user changes in your application. During
development this might lead to situations where changes are not
correctly applied and displayed, e.g. you define a new menu entry and
this entry is not displayed in your application.
You have to add -clearPersistedState as a program argument for your application or set the Clear flag in the Main tab of your Run configuration.
Take a look here for further information and a more detailed description.

IntelliJ productivity tips running tomcat

I'm developing using IntelliJ 11u on a spring mvc application using tomcat.
I tried the maven jetty plugin, but after a few builds I keep getting java permGen issues and then it just hangs. I was told this was because spring uses log4j and it has some sort of leaks?
Anyhow, I'm asking for tips to help fire up a server, tomcat, with my updated code so I can make quick updates and have tomcat reloaded.
Here are my current annoyances with tomcat:
Only code changes seem to get auto-reloaded, if I make changes to my view pages things don't get updated unless I redeploy. The maven jetty plugin seems to map to my view pages directly and I saw updates to my view pages instantly w/o it even redeploying.
if I have more than 1 thing running in intelliJ, like say I have a main program that I run, or a unit test, IntelliJ seems to re-order what gets run in the run drop down menu and also the shortcut keys get changed to the last thing I ran.
I use google chrome, for some reason when I start tomcat it brings firefox to the forefront and opens a new tab each and every time.
If someone can address any or all of the above issues that would be great as I hate this dance I have to go through just to update/redeploy my application. I wish it could just be a consitant method, using shortcuts or automatically without me having to close the tab created in firefox, and then minimizie it, or redploy for a simple view change etc.
You should configure IDEA to update classes and resources and enable a checkbox in the Run configuration to do it automatically on frame deactivation.
Browser can be changed in IDEA settings and you can disable opening browser at all in Tomcat Run/Debug configuration.
As for the Run panel tabs order, you can pin tabs using the tab right click menu, in this case they will remain in the Run or Debug panel in the order they were created.
Look at JRebel if you want an even more productive environment (It costs, but I find it is worth it). As you can see here, http://zeroturnaround.com/jrebel/features/, it increases the types of changes you can hot-swap (no waiting for a build). I am currently evaluating it myself and will probably pick up a full license.
BTW, if you develop in scala (it looks like you're not, but just in case) the plugin is free.

eclipse or Myeclipse Debug "Display" view does not show code assist

About eclipse debug "Display" view
Display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type the name of the variable in the Display view, and you'll be greeted with a familiar content assist.
http://www.ibm.com/developerworks/library/os-ecbug/
I have stopped at break point and used Display view for some code inspection and execution but I could not get the code assistance in the Display view. Although copy paste a code and executing it works ok.
Having code assist will be very helpful, I get the code assist when defining Breakpoint condition.
Regards,
Rashid
Does Ctrl+Space not get you content assist? It does for me. I don't think it's automatic unless you are trying to call a method on an object by typing the . after the object.
I faced the same issue that all the debug tabs are lost and could not restore it via Windows > Show View > Variable/Display, it always remains disappear.
Now I just got things back by resetting the Debug perspective to get the Variable and Display tab back.

Eclipse: The icons in "Display View" are all greyed out

The discussion here describes the "display view" in eclipse which allows one to to quickly evaluate java expressions. The thing is, when I open the display view the icons remain greyed out and I can't execute anything. The only icon that isn't is "clear console". The odd thing is, alot of the screenshots on the web show the same behaviour but the people posting about the feature don't mentioned it. There aren't any options in the context sensitive menu either. I'm trying it on a java project. I've tried it in the debug view and I get the same issue.
I'll provide a screenshot once my hosting is sorted.
I'm using eclipse 3.4.
To be able to use it, you're supposed to be in debug mode (set a breakpoint to freeze execution). That gives you a context, a stack frame to work in.
Once you're there, you select expressions in the display view and only then can you execute them, evaluate etc. If no text in the view is selected, none of the actions will be available.
As I understand, the purpose of the 'Display' view is to allow to evaluate expression during debug sessions. Are you trying to evaluate some expressions statically (i.e. with no running application in debug mode)?

Categories

Resources