creating multiple edit parts in one drag from palette in GEF eclipse - eclipse

I am currently using GEF framework for one of my requirement.
wish to create multiple figures with independent figures when dragging an item from the palette.
i am not sure the best approach to take for this. an edit part can only
create a single figure with child's inside. But i need independent figures.
Please let me know is there any way in GEF.

Have your implementation of EditPartFactory. When you drag an object from your Palette or viewer which contains the templates, create your model objects in class which implements CreationFactory.

Related

How to focus on an object in a diagram in Enterprise Architect?

Developing an Extension in Enterprise Architect, it's possible to call Repository.OpenDiagram() function and open a specific diagram. Using the Diagram.SelectedObjects, objects on that diagram can be selected and the list of the selected ones is accessible. However, there I need to focus on a selected object, but cannot find the corresponding EA API/function.
How could I focus on an object so that it be displayed in the center of diagram window (without changing the real position of the object)?
Thanks in advance for any hint!
You can't, except if you use a windows library to simulate clicks on the scrollbar or something like that.
But I'm not recommending that approach as you'll never be sure it will actually put the element in the center.

How to Programmatically Add Items to Eclipse's Problems View

I'm developing an Eclipse plugin where I need to add custom items to Eclipse's problems view. Custom items under maybe custom categories (for example list a bunch of problems under a category named "security").
I have looked into marker, but these are for file editors. I want to add custom items to the problems view without having to do anything with a source editor. Is that possible? Or do I have to create my own view?
Thanks!
I think you just need to add the problem view to your plug-in.
org.eclipse.ui.views.ProblemView
You can create markers on Folders/Projects. You don't need to have a File to create a marker. The markers can be grouped via the type of Marker in the Problems View
The Problems view only supports displaying markers.
Markers are associated with resources (usually files) but any plugin can create them, they don't have to done by editors.

How to implement a image list control with SWT?

Does anybody have any idea on how to easily implement a image list(like the windows explorer with medium icons) control with swt? it seems like that it could be done easily with CListCtrl in c++ on windows, but does not seem to be easy with swt? any hints are appreciated!
Up to me, you need to create your own widget (check e.g. http://www.snip2code.com/Snippet/11489/Custom-SWT-List-Box) and add composite items to your custom list.
If vertical-only scrolling is enough, I suggest you rely on a single column TableViewer. This is what I did in a project where I needed a gallery-like window allowing the user to pick a graphical component based on displayed thumbnails.
You just need to implement the proper TableLabelProvider.getColumnImage and return the desired thumbnail corresponding to your list entry.
That gives a pretty decent list-like rendering.
In addition, TableViewer API is very well documented.

Can I develope a dynamic GUI with glade?

This is a newbie question so forgive me but I'm confused.
Suppose, as a simple example, that I wish to have a GUI that has a button to add some component (say a file chooser widget) to the interface as many times as I want. (and maybe another button to remove the last if you wish to think more pragmatically). How would I design such a thing using glade? Is there any way to have the buttons "working" inside glade itself?
My guess is that I can only design the default interface and then I am manually responsible for the callbacks that will add and remove components. My GUI will however be static from within glade so I can only test it during runtime. Is that the basic idea?
You're correct, there is no way to test the callbacks in glade itself and you can only test it during runtime.

Dynamically create Eclipse Perspective with views

I can create an Eclipse perspective and add viewparts to it using plugin.xml and the declarative definitions.
However, I need to programatically create a perspective, set its name/title and add two viewparts to it in a split-view (one viewpart on the left and the other on the right).
I have searched the net and read through a lot of documentation but can't figure out how to do this. Does anyone have a small example of this? Maybe knows what to search for?
You should be to create a new perspective via IPerspectiveRegistry.clonePerspective(String id, String label, IPerspectiveDescriptor desc). Here the original perspective, desc, can be null, but I haven't found a way to set the image for the new perspective.
You can add the needed views via IWorkbenchPage.showView(...), but have never figured out how to lay out the new view in the perspective...