Rearranging a Compartment? [message #56656] |
Wed, 27 September 2006 22:21 |
Eclipse User |
|
|
|
Originally posted by: amoiln.sktcorp.com
How do I manage to rearrange items in a Compartment? For instance, in
the Mindmap tutorial example, it is easy to create a Thread with a bunch
of Thread Items, but suppose after I create the Thread Items I want to
rearrange them. Is there any way to make a (user interface) control to
do that? I can't seem to figure it out.
Thanks!
Arthur Molin
|
|
|
|
Re: Rearranging a Compartment? [message #58458 is a reply to message #58404] |
Tue, 03 October 2006 01:06 |
Eclipse User |
|
|
|
Originally posted by: amolin.sktcorp.com
I cannot find ArrangeAction anywhere. Can you provide a little more
information? What package is it in?
Thanks!
Arthur
Mohammed Mostafa wrote:
> Hi Arthur:
> Check the ArrangeAction
> Arthur Molin wrote:
>> How do I manage to rearrange items in a Compartment? For instance, in
>> the Mindmap tutorial example, it is easy to create a Thread with a bunch
>> of Thread Items, but suppose after I create the Thread Items I want to
>> rearrange them. Is there any way to make a (user interface) control to
>> do that? I can't seem to figure it out.
>>
>> Thanks!
>>
>> Arthur MolinI cannot find ArrangeAction anywhere. Can you provide a little
more information? What package it is in?
Thanks!
Arthur
|
|
|
Re: Rearranging a Compartment? [message #58469 is a reply to message #58458] |
Tue, 03 October 2006 01:56 |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
package org.eclipse.gmf.runtime.diagram.ui.actions.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.draw2d.Animation;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.commands.Command;
import org.eclipse.gef.commands.CompoundCommand;
import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.tools.ToolUtilities;
import org.eclipse.gmf.runtime.diagram.ui.actions.ActionIds;
import org.eclipse.gmf.runtime.diagram.ui.actions.DiagramAction;
import org.eclipse.gmf.runtime.diagram.ui.actions.internal.l10n.Dia gramUIActionsMessages;
import org.eclipse.gmf.runtime.diagram.ui.actions.internal.l10n.Dia gramUIActionsPluginImages;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart ;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditP art;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmen tEditPart;
import org.eclipse.gmf.runtime.diagram.ui.preferences.IPreferenceCo nstants;
import org.eclipse.gmf.runtime.diagram.ui.requests.ArrangeRequest;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IWorkbenchPage;
/**
* The Arrange Action: arranges a container editpart or a set of selected editparts
*
* @author melaasar
* @canBeSeenBy %level1
*/
public class ArrangeAction extends DiagramAction {
On Tue, 03 Oct 2006 01:06:08 +0000, Arthur Molin wrote:
> I cannot find ArrangeAction anywhere. Can you provide a little more
> information? What package is it in?
>
> Thanks!
>
> Arthur
>
> Mohammed Mostafa wrote:
>
>> Hi Arthur:
>> Check the ArrangeAction
>
>> Arthur Molin wrote:
>>> How do I manage to rearrange items in a Compartment? For instance, in
>>> the Mindmap tutorial example, it is easy to create a Thread with a bunch
>>> of Thread Items, but suppose after I create the Thread Items I want to
>>> rearrange them. Is there any way to make a (user interface) control to
>>> do that? I can't seem to figure it out.
>>>
>>> Thanks!
>>>
>>> Arthur MolinI cannot find ArrangeAction anywhere. Can you provide a little
> more information? What package it is in?
>
> Thanks!
>
> Arthur
|
|
|
Re: Rearranging a Compartment? [message #58987 is a reply to message #58469] |
Tue, 03 October 2006 17:44 |
Eclipse User |
|
|
|
Originally posted by: amolin.sktcorp.com
If I understand this correctly, ArrangeAction is the action which is used
to arrange nodes programmatically. I need to give the user of the editor
the capability to rearrange items manually--select an item and drag it to
another place in the Compartment.
You can drag an item to another Compartment in the editor, but not to
another place in the same Compartment.
Also, as far as I can tell, with a GMF editor you cannot insert an item
into the middle of a Compartment. With an EMF editor, you can select an
item and a menu item says "Add Sibling", but there is nothing for GMF.
Thanks for your help!
Arthur Molin
Vlad Ciubotariu wrote:
> package org.eclipse.gmf.runtime.diagram.ui.actions.internal;
> ...
> public class ArrangeAction extends DiagramAction {
>>
>>> Arthur Molin wrote:
>>>> How do I manage to rearrange items in a Compartment? For instance, in
>>>> the Mindmap tutorial example, it is easy to create a Thread with a bunch
>>>> of Thread Items, but suppose after I create the Thread Items I want to
>>>> rearrange them. Is there any way to make a (user interface) control to
>>>> do that? I can't seem to figure it out.
>>>>
>>>> Thanks!
>>>>
>>>> Arthur MolinI cannot find ArrangeAction anywhere. Can you provide a
little
>> more information? What package it is in?
>>
>> Thanks!
>>
>> Arthur
|
|
|
Re: Rearranging a Compartment? [message #59613 is a reply to message #58987] |
Thu, 05 October 2006 15:11 |
Eclipse User |
|
|
|
Originally posted by: vcciubot.uwaterloo.ca
This has to do with the layout edit policy installed on your compartment
edit part. Here's a configuration that works for me. The
ShapeCompartmentEditPart installs an XYLayoutEditPolicy that allows you
to rearrange things in your compartment.
You can ignore the last two other edit policy installed on this
edit part:
public class BlockChildrenCompartmentEditPart extends ShapeCompartmentEditPart {
public BlockChildrenCompartmentEditPart(View view) {
super(view);
}
public String getCompartmentName() {
return "BlockChildrenCompartment";
}
public IFigure createFigure() {
ResizableCompartmentFigure result = (ResizableCompartmentFigure) super
.createFigure();
result.setTitleVisibility(false);
return result;
}
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.CREATION_ROLE,
new CreationEditPolicy());
installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLE,
new DragDropEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE,
new BlockCanonicalEditPolicy());
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
new BlockChildrenCompartmentCreationEditPolicy());
}
....
}
The edit parts contained in this compartment extend ShapeNodeEditPart.
Hope this helps.
vlad
On Tue, 03 Oct 2006 17:44:58 +0000, Arthur Molin wrote:
> If I understand this correctly, ArrangeAction is the action which is used
> to arrange nodes programmatically. I need to give the user of the editor
> the capability to rearrange items manually--select an item and drag it to
> another place in the Compartment.
>
> You can drag an item to another Compartment in the editor, but not to
> another place in the same Compartment.
>
> Also, as far as I can tell, with a GMF editor you cannot insert an item
> into the middle of a Compartment. With an EMF editor, you can select an
> item and a menu item says "Add Sibling", but there is nothing for GMF.
>
> Thanks for your help!
>
> Arthur Molin
>
> Vlad Ciubotariu wrote:
>
>> package org.eclipse.gmf.runtime.diagram.ui.actions.internal;
>> ...
>> public class ArrangeAction extends DiagramAction {
>
>
>>>
>>>> Arthur Molin wrote:
>>>>> How do I manage to rearrange items in a Compartment? For instance, in
>>>>> the Mindmap tutorial example, it is easy to create a Thread with a bunch
>>>>> of Thread Items, but suppose after I create the Thread Items I want to
>>>>> rearrange them. Is there any way to make a (user interface) control to
>>>>> do that? I can't seem to figure it out.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Arthur MolinI cannot find ArrangeAction anywhere. Can you provide a
> little
>>> more information? What package it is in?
>>>
>>> Thanks!
>>>
>>> Arthur
|
|
|
Re: Rearranging a Compartment? [message #80498 is a reply to message #58987] |
Thu, 23 November 2006 15:59 |
Eclipse User |
|
|
|
Originally posted by: benjamin_fu.126.com
I have the same problem.
I found that FlowLayoutEditPolicy can do the work, but need to override the
method :
protected Command createMoveChildCommand(EditPart child, EditPart after)
In Logic example the LogicFlowLayoutEditPolicy do not implement the method
above, any one who can give some example code to do the rearrange work?
Br,
Ben
"Arthur Molin" <amolin@sktcorp.com>
??????:51f6d75ad8d2226c9bb37eed7f06c4d1$1@www.eclipse.org...
> If I understand this correctly, ArrangeAction is the action which is used
> to arrange nodes programmatically. I need to give the user of the editor
> the capability to rearrange items manually--select an item and drag it to
> another place in the Compartment.
>
> You can drag an item to another Compartment in the editor, but not to
> another place in the same Compartment.
>
> Also, as far as I can tell, with a GMF editor you cannot insert an item
> into the middle of a Compartment. With an EMF editor, you can select an
> item and a menu item says "Add Sibling", but there is nothing for GMF.
>
> Thanks for your help!
>
> Arthur Molin
>
> Vlad Ciubotariu wrote:
>
>> package org.eclipse.gmf.runtime.diagram.ui.actions.internal;
>> ...
>> public class ArrangeAction extends DiagramAction {
>
>
>>>
>>>> Arthur Molin wrote:
>>>>> How do I manage to rearrange items in a Compartment? For instance, in
>>>>> the Mindmap tutorial example, it is easy to create a Thread with a
>>>>> bunch of Thread Items, but suppose after I create the Thread Items I
>>>>> want to rearrange them. Is there any way to make a (user interface)
>>>>> control to do that? I can't seem to figure it out.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> Arthur MolinI cannot find ArrangeAction anywhere. Can you provide a
> little
>>> more information? What package it is in?
>>>
>>> Thanks!
>>>
>>> Arthur
>
|
|
|
Powered by
FUDForum. Page generated in 0.04324 seconds