Problems with ALIGN_LEFT, ALIGN_RIGHT, ... toolbar buttons [message #169371] |
Wed, 23 February 2005 03:48  |
Eclipse User |
|
|
|
Hi,
The toolbar buttons for ALIGN_xxx are disabled in one of my editors
and I don't know why!!!
- I have implemented 2 Editors with this feature.
- The editors works on different parts on my model.
- The ALIGN_xxx Buttons are visible for the 2 editors.
- The first editor works fine.
- In the second editor the ALIGN_xxx buttons are always disabled.
(the MATCH_HEIGHT, MATCH_WIDTH are visible and enabled if I select
2 or more editparts).
Question:
What's the required prerequisite to enable the toolbar buttons for
the ALIGN_xxx feature?
I have implement a EditorContributor and register the actions like:
toolBarManager.add(getActionRegistry().getAction( GEFActionConstants.ALIGN_LEFT));
.
.
I Register the actions in the editor:
action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.RIGHT);
registry.registerAction(action);
getSelectionActions().add(action.getId());
Is there any additional todo?!
Can anybody tell me the required prerequisite for the ALIGN_xxx feature?!!
greetings
Andreas
|
|
|
|
|
Re: Problems with ALIGN_LEFT, ALIGN_RIGHT, ... toolbar buttons [message #169918 is a reply to message #169666] |
Mon, 28 February 2005 04:04  |
Eclipse User |
|
|
|
Originally posted by: bartgolsteijn.hotmail.com
Hi Andreas,
I has the same problem when creating an editor based on the shapes
example. To solve the problem I had to add two lines to the canExecute()
method of the SetConstraintCommand for the children to be aligned:
public boolean canExecute() {
Object type = request.getType();
// make sure the Request is of a type we support:
return (RequestConstants.REQ_MOVE.equals(type)
|| RequestConstants.REQ_MOVE_CHILDREN.equals(type)
|| RequestConstants.REQ_RESIZE.equals(type)
|| RequestConstants.REQ_RESIZE_CHILDREN.equals(type)
|| RequestConstants.REQ_ALIGN.equals(type)
|| RequestConstants.REQ_ALIGN_CHILDREN.equals(type));
}
Hope that helps.
Greetings,
Bart Golsteijn
FreeGroup wrote:
>> Hi,
>>
>> I had the very same problem - are you using some kind of
>> MultiPageEditor(Part) ? Are both editors children of such an editor?
>> If that's the case, check if selection changes are properly detected.
>>
>> HTH
>>
>> Fabian
> Hi,
> no - I use a simple single page GEF Editor.
> Is the any documentation for the prerequisits for the enable/disable
> the toolbar action for the alignment available.
> OR
> where is the code for the state calculation of these buttons?
> greetings
> Andreas
|
|
|
Powered by
FUDForum. Page generated in 0.04292 seconds