Create a GUI using WindowBuilder's visual designer - eclipse

My question's really that simple. So simple that no one bothered to put the answer anywhere! I've tried googling 'open WindowBuilderPro' but 5-10 mins searching through links I'm no closer to an answer.

In Eclipse's Package Explorer pane, right-click on the package that you want your new GUI class to be in (create a new package first if it doesn't exist).
Select New/Other... from the pop-up menu.
Under "WindowBuilder", expand "Swing Designer".
Select "JFrame".
Click "Next".
In the subsequent dialog window, be sure that the package name is correct and type in the desired class name for your new GUI frame. Use a clearly descriptive name that tells the reader what this frame is for and that it is a frame, e.g. "MainAppFrame".
The "Use Advanced Template" checkbox should be checked.
Click "Finish"
Now click on the Design tab (at the BOTTOM of the editor!) credit to duDE for that bit.

Related

Adding New Components in WindowBuilder Design View

At risk of this being a trivial question, I need to know how to add more components (in the components explorer) in WindowBuilder for Eclipse Juno. I'm taking a dive and trying learn how to add a GUI to one of my personal projects. Right now all I have mustered up is just a JFrame that has a button that launches my program in the console with a little notification saying so. But what I am thinking about having is a "Start up Window" with just some stuff and button or something that says Enter application or something. So then I want a new window to pop up as a "Run Window". I have created a new JFrame as a "run window" and hide/set visibility of "startWindow" to false and get the result I want. But I want to be able to edit this new JFrame in the design window along with the default JFrame I started with.
Is there a way to do this? I tried right-clicking in the components window in the design view and it doesn't do anything. I also tried right-click the object from the project explorer and couldn't find anything. Am I missing something? Is this even possible?
The question seems to have 2 parts, so I will try to answer both of them.
1) Adding components directly in the components explorer
The only thing you could do, to get new components into there via right-click is "Surround with". For example you have a JPanel, right-click on it and click "Surround with...". You could try and put a JScrollPanel in there, so you can scroll your JPanel.
But the usual way to add components is by the "Palette", it contains a lot of components, that you can drag&drop into either the components-explorer or directly into your app Window -> Show View -> Palette.
2) Showing a certain window
If I understand this correctly, you want to show one window, click on a button and then show another window which has the same size etc. like the one before.
Setting the visibility for the first window to false and the second does work.
But under certain circumstances it's easier to use CardLayout.
Imagine a stack of cards, you can see only the first card. Then you click a button and now see the second card and so on.
See this: https://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
for information and examples.

Xcode 4 anything like right click to find in project?

In Xcode 3, I could right click on some text in my code, select find in project, and it would.
Is there anything like that in Xcode 4, where I can search for something without typing it in?
EDIT: to clarify, my concern is to avoid having to enter whatever I am searching for.
In other words, suppose I have methods called
methodWithReallyLongNameVersionA
and
methodWithReallyLongNameVersionB
It would be nice to be able to search for the first one via a right click search, without having to copy and paste or to type the whole thing in. This was possible in XCode 3.
I created a custom find scope and then used that find scope to search all within a project folder.
Create find scope as follows:
In Navigator selector bar click the magnifying glass to bring up search navigator
click the magnifying glass in the search text box and select 'show find options'
clock 'Find in' list and select custom
Create your new find scope in the dialog and set it to your project top level folder
Use this find scope in future searches.
Command + Shift + F will search your workspace.
At the time I asked this question, the answer was "no." However, Apple has now restored this functionality. Right click on the text in question, then select "find selected text in workspace" from the drop-down menu.

Detached windows in Eclipse, is this possible?

Is there a way (plugin) in Eclipse to open detached windows which can be put on separate monitors: e.g one monitor will have my source, second threads and variables? The feature is in IntelliJ.
Yes. From the "Window" menu select "New Window". You can also drag the tabs off of the main window and a new window with just that tab will be created.
If you want a window with just the source code by itself, dragging the tab with the source in it won't work. What you can do is create the new window, drag the source over and minimize any other existing tabs within the new window to essentially leave a "source code only" view. You should be able to save this as a perspective and name it "Editor Only". This is somewhat cumbersome to setup, but once you have the perspective saved it should be pretty easy to get in and out of.
This is available in Helios and possibly earlier versions.
You can right-click on the title of any "View" and choose "Detach", this way you won't need two mail windows.

Eclipse plug-in: How to create a new menu for eclipse plugin with key combination?

I've been looking about this question but I couldn't find it. I need to create a new "popup menu" and assign a key pressed (in other words, I need press "F3+right-click" (for example) and this action will be appear a new popup menu, with my actions in my workbench). I don't need a submenu for my right-click... i need a new and alone menu
Example, in eclipse, when i right-click with my mouse over workbench I see a popmenu with: "undo, revert file, save, cut, copy..." and more, but i need create a new menu instead of eclipse menu, so, when I press "F3+right-click" (example) i need see my popup-menu with my actions... this is my problem, i need to create a new menu and call it with key/mouse combination...
I've been reading the forums but i don't know where to post this question and I don't know where to search (maybe i write a wrong question in the search... i think...).
I hope someone can help me.
Thank you very much;)
I assume that you would like to see this menu in an editor (rather than in a view because that would be slightly different). Most of what you need to do here is to extend eclipse extension points through declaring them in the plugin.xml for your plugin.
Thankfully, Eclipse ships with a few extension point wizards to help you get started with this. To get there, do the following
Open the plugin.xml for your plugin
Go to the extensions page
Click on Add...
Click on Extension Wizards
The "Popup Menu" wizard
After filling in all the details, there are still a few more pieces that you need to do.
The wizard creates an Object contribution, that will add the new popup menu to an object of a specified type in all views. You can change this to being an editor contribution, so that the menu item will show in editors instead.
The final step is to connect this menu item with a key-binding. For that, you need to create a new Command extension.
Start with the Command extension point wizard.
After filling in the details, you get a command, a handler, and a binding. You can remove the handler, since you will connect your action created previously to the command you just created.
From here, you need to fill in all of the stub Java classes created by the wizards and you should be in business.
This is a very rough set of steps you need to do to implement the keybindinds (and, yes, it is way more complicated than it needs to be). For more detail, you can go here:
http://www.vogella.de/articles/EclipseCommands/article.html

How to Display Current Function in Eclipse

I miss a certain functionality in Eclipse. I would like to know the name of the current function the cursor is currently inside. This is useful when browsing unknown code using the search function, for example.
Any idea how to show it? Maybe a plugin?
I'm using the "Toggle Breadcrumb" option from toolbar:
It shows a nice breadcrumb, ending with current function name.
It's quite handy for me, as Outline becomes cumbersome to use if you have zilions of functions.
It produces the following structure above your Java Editor (truncated at the picture below):
The "Outline" view shows the current function.
It may be necessary to enable the 'Link to Editor' option in the Outline View dropdown menu. This might be off by default for CDT.
I was looking for something similar (Xcode-like bar at the top showing the current function, where you can also go to another function by clicking on it to open a popup list of functions). Here is what I settled on with Eclipse 3.5.1 CDT:
I moved the Outline view to the top, resized it to make it a 1-line horizontal strip (don't make it too narrow), and selected "Link With Editor" in its menu, so that it always shows the current function. However, this doesn't open a popup list like Xcode. For that functionality, I assigned a shortcut to the "Show Outline" command which does open a popup list of all functions.
The Eclipse function 'show outline' will pop up a list of outline objects, and it will highlight the object your cursor is inside in grey. It's typically bound to 'ctrl-o' (the letter 'o', not zero), but you can re-bind it as you see fit. I'm running Eclipse with the CDT plugin and it works pretty well for me.
To enable the breadcrumb invoke Toggle Java Editor Breadcrumb in the toolbar or press Alt+Shift+B in the Java editor.
You can also display the Quick Outline (ctrl+o). This way you see the context quickly without having to have a permanent Outline Window linked to the Editor.
Use the "Link With Editor" option on the outline menu
Press Ctrl+o (cursor is currently inside a function at a particular line).
It highlights the current method, or name of the class if the cursor is outside the method body.
You can click on highlighted method.
It has got inline search feature ...start typing name of the method to navigate to the specified method or method with matching search pattern.
If you press again Ctrl+o to shows the inherited members/methods.
Using outline with "link with editor" option worked also for me, thanks!
Just an addition, you can move outline pane in to the same window group as search, progress etc. saves the space in your perspective instead of keeping it at another group.