Solution for syncing the current project data across Eclipse plugin views? - java

I am making a set of Eclipse Plugins.
Each of these plugins display some data with respect to a project in the Eclipse Workspace.
What is the best practice/solution for loading data with respect to a unique project in each of these views?
I have the following options with me
1.)I provide a dropdown in each of the views and when the user changes dropdown the view gets refreshed with the respective project data.
2.)I give the User a "Load All Views" button when he right clicks in the package explorer and when he clicks this all views get loaded with the respective project data from package explorer
3.)Is there some other standard way?

Option 1.) seems to be the cleaner and unambiguous way to go.
Communication across views can be done using the selection service
Selection Service

Related

Cloning an android activity dynamically?

I'm creating an application with a rather dynamic UI that allows users to add/change the positions of its views and layouts dynamically. If the user decides that current UI design satisfies him he would be able to save all views(buttons/labels/switches/etc.) of the activity into a list of "saved" activities. Is there a possible way to clone an activity or at least save the positions of all views and layouts? I saw that views have functions .getX() and .getY() but as far as I understood it is only within a layout.
Update
I found a solution that works. I created a simple Sqlite Database the stored the XY locations/names/text/id of all my views in to a table dynamically and then displayed them in a list of 'saved' configurations. The hard part is creating dynamically again all the views after you get the DB. If there is a request, I can also put some code up.
I'd create a base-activity, that has the functionality that both of your Activities need. This functionality would have to be slightly abstracted so that both activites could use this functionality by extending this BaseActivity and use it for their individual purposes.
If you post some code (the part of code both of your activities should have), I could update my answer to show you how that would look like in your case.
Further,
Step #1: Open the old project in Android Studio.
Step #2: Open the new project in Android Studio, choosing to open it in a new window (rather than the window you have from Step #1).
Step #3: Drag and drop the Java class files from the old project into the new project.
Step #4: Drag and drop the resources used by those Java classes from the old project into the new project.
Step #5: Find the elements from the manifest of the old project and copy those into the same basic location in the manifest of the new project.

Associate eclipse plug-in view with a file extension

I'm developing an eclipse plug-in and I would like to open files with a certain extension (e.g. .xml) with the View tab of my plug-in. Is this possible? I know this can be done for editors like this In plug-in.xml how to associate a file extension with a particular kind of editor in eclipse plug-in.
The difference between a View and an Editor has diminished with Eclipse 4. This means that you can dock editors outside the shared area on a view stack. Go ahead and try it by dragging an Editor by its title and dropping it on a view stack.
Furthermore, it is very well possible to edit files in views if you want to implement this yourself. For this to happen you have to implement ISaveablePart [1] on the view. When you implement this, the view will play in the change/dirty/save editor lifecycle of the workbench.
[1] http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2FISaveablePart.html
No, it is not possible.
The closest you can get is to add a separate 'open in view' menu item.

Intellij IDEA multiply windows project explorer

Could somebody tell me if it is possibile to open two instances of the same project in Intellj IDEA or can I for example have two windows with opened different project files with attached project explorer.
I asking for that because I have two monitors and it will be more efficient to navigate on each windows separately.
For now I must drag tab from root window and drop to another window which it is annoying and unhandy.
This is not possible. IntelliJ IDEA has a one project one window paradigm.
Some suggestions, in order of best to worst, that may help:
The navigation bar (Alt+Home or ⌥⇱ {Option Home}) can be used in place of the project tool window. You can use it either in pop-up mode or anchored mode (View > Navigation Bar). When a file is opened via the navigation bar, it opens in the window that has focus. The nav bar is ultimately a horizontal project window. Check the help documents for how to easily navigate through the nav bar. Once you get use to it, you may find you never use the project tool window again.
Have you tried floating the project window and placing it on the edge of one of the monitors so it sites between the two editor windows? While you would still need to drag file to the second editor window, it might prove easier.
You could create a second project with the all the same modules as the first project (just being sure to save the second project's .idea configuration directory in a different location). But this would require keeping two project configurations in sync, and you would need to make sure the "synchronize files on frame activation" setting is on. In the end, I think that is far more hassle then it is worth.
Hope that helps.
(FYI, I may be new to StackOverflow, but I'm a ten year passionate and evangelical IntelliJ IDEA user.)

neteans hide packages from view

I wonder if it is possible, to hide some packages (or directories) from the netbeans package view window.
Currently, I am working on a project, which has many projects, but I only know some of them.
I like the list view, so just collapsing it to a tree is not what I'm searching for.
Thanks in advance!
You can't hide only some packages of some project, you've got opened. You can only show/hide whole projects. If you don't want to have so many projects opened in your current perspective, just click with you RMB to that project and click Close. Then press select it with LMB and press Delete. Just be sure NOT to check Delete files also on local disc, otherwise, you permanently lost your files!!!

java with eclipse - lost design page

I am learning Java using Eclipse - started a project with javax.swing and could view a design page with my page layouts shown and various palets for components etc. Now this design page seems to have vanished and I cant discover any option to recover it. I hope someone can get me back on track.
Have you tried Right-click on class (for example MySwingPanel.java) in package editor Open With->WindowBuilder Editor?
The last time you selected something in Open With - this is the editor to open that file on double click.
Have you tried changing the Perspective? Click the arrows next to the DDMS tab in the upper right hand corner of Eclipse and select the 'Java' Perspective.

Categories