"Shapes" enhancement [message #205462] |
Sun, 18 December 2005 10:54 |
Eclipse User |
|
|
|
Originally posted by: martyn.barry.xtra.co.nz
Hi,
I have read a lot of the available GEF, SWT, JFace documentation and am
currently running the "Shapes" example via the debugger to get an
understanding of the overall structure.
I would like to create a tool in GEF which is probably a straightforward
enhancement to the "shapes" example.
I am relatively new to Eclipse and GEF (and Java!) so I would appreciate any
pointers on how the following specification could be met.
My proposed tool would involve:
1/ Removing the ellipse shape
2/ Enhancing the rectangle shape so that a user can enter/edit text inside
it
3/ The text would all be in the same font (although if different fonts are
possible within the other constraints presented here, please tell me how!)
4/ The text would wrap-to-next-line within the rectangle width
5/ The text may have newlines in it (in which case new paragraph starts as
is usual)
6/ The text would get a vertical scrollbar if it exceeds the rectangle
height (and of course scrollbar would disappear if resized rectangle
accommodates entire text)
7/ Ideally, if the focus is not on a particular rectangle, a click to its
text would place the cursor immediately at the text position clicked on
(unlike the "flow" example in which the first click causes the entire text
to be selected).
From what I have read, one solution might be to manage instances of
org.eclipse.jface.viewers.TextCellEditor
as children of the rectangles.
Is there a class available which incorporates the rectangle *and* the
contained text... or is it better to keep the rectangle separate from the
contents, maybe for the purpose of controlling the positions of the handles
on it?
Please comment.
Thanks, Martyn.
|
|
|
Re: "Shapes" enhancement [message #205524 is a reply to message #205462] |
Mon, 19 December 2005 11:23 |
Eclipse User |
|
|
|
Originally posted by: ingo.koch[nospam].sap.com
Have a look at the logic examples StickyNote, which will meet nearly all of
your requirements.
Regards, Ingo
"Martyn Barry" <martyn.barry@xtra.co.nz> wrote in message
news:do3f6l$n0b$1@news.eclipse.org...
> Hi,
>
> I have read a lot of the available GEF, SWT, JFace documentation and am
> currently running the "Shapes" example via the debugger to get an
> understanding of the overall structure.
>
>
>
> I would like to create a tool in GEF which is probably a straightforward
> enhancement to the "shapes" example.
>
> I am relatively new to Eclipse and GEF (and Java!) so I would appreciate
any
> pointers on how the following specification could be met.
>
>
>
> My proposed tool would involve:
>
>
>
> 1/ Removing the ellipse shape
>
> 2/ Enhancing the rectangle shape so that a user can enter/edit text inside
> it
>
> 3/ The text would all be in the same font (although if different fonts are
> possible within the other constraints presented here, please tell me how!)
>
> 4/ The text would wrap-to-next-line within the rectangle width
>
> 5/ The text may have newlines in it (in which case new paragraph starts as
> is usual)
>
> 6/ The text would get a vertical scrollbar if it exceeds the rectangle
> height (and of course scrollbar would disappear if resized rectangle
> accommodates entire text)
>
> 7/ Ideally, if the focus is not on a particular rectangle, a click to its
> text would place the cursor immediately at the text position clicked on
> (unlike the "flow" example in which the first click causes the entire text
> to be selected).
>
>
>
> From what I have read, one solution might be to manage instances of
>
> org.eclipse.jface.viewers.TextCellEditor
>
> as children of the rectangles.
>
>
>
>
> Is there a class available which incorporates the rectangle *and* the
> contained text... or is it better to keep the rectangle separate from the
> contents, maybe for the purpose of controlling the positions of the
handles
> on it?
>
>
>
> Please comment.
>
>
>
> Thanks, Martyn.
>
>
|
|
|
Re: "Shapes" enhancement [message #205935 is a reply to message #205524] |
Fri, 23 December 2005 10:14 |
Eclipse User |
|
|
|
Originally posted by: martyn.barry.xtra.co.nz
Thanks for that - gives me a good start.
"Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
news:do5jks$hbl$1@utils.eclipse.org...
> Have a look at the logic examples StickyNote, which will meet nearly all
> of
> your requirements.
>
> Regards, Ingo
>
> "Martyn Barry" <martyn.barry@xtra.co.nz> wrote in message
> news:do3f6l$n0b$1@news.eclipse.org...
>> Hi,
>>
>> I have read a lot of the available GEF, SWT, JFace documentation and am
>> currently running the "Shapes" example via the debugger to get an
>> understanding of the overall structure.
>>
>>
>>
>> I would like to create a tool in GEF which is probably a straightforward
>> enhancement to the "shapes" example.
>>
>> I am relatively new to Eclipse and GEF (and Java!) so I would appreciate
> any
>> pointers on how the following specification could be met.
>>
>>
>>
>> My proposed tool would involve:
>>
>>
>>
>> 1/ Removing the ellipse shape
>>
>> 2/ Enhancing the rectangle shape so that a user can enter/edit text
>> inside
>> it
>>
>> 3/ The text would all be in the same font (although if different fonts
>> are
>> possible within the other constraints presented here, please tell me
>> how!)
>>
>> 4/ The text would wrap-to-next-line within the rectangle width
>>
>> 5/ The text may have newlines in it (in which case new paragraph starts
>> as
>> is usual)
>>
>> 6/ The text would get a vertical scrollbar if it exceeds the rectangle
>> height (and of course scrollbar would disappear if resized rectangle
>> accommodates entire text)
>>
>> 7/ Ideally, if the focus is not on a particular rectangle, a click to its
>> text would place the cursor immediately at the text position clicked on
>> (unlike the "flow" example in which the first click causes the entire
>> text
>> to be selected).
>>
>>
>>
>> From what I have read, one solution might be to manage instances of
>>
>> org.eclipse.jface.viewers.TextCellEditor
>>
>> as children of the rectangles.
>>
>>
>>
>>
>> Is there a class available which incorporates the rectangle *and* the
>> contained text... or is it better to keep the rectangle separate from the
>> contents, maybe for the purpose of controlling the positions of the
> handles
>> on it?
>>
>>
>>
>> Please comment.
>>
>>
>>
>> Thanks, Martyn.
>>
>>
>
>
|
|
|
Re: "Shapes" enhancement [message #206234 is a reply to message #205462] |
Tue, 27 December 2005 05:01 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> 2/ Enhancing the rectangle shape so that a user can enter/edit text inside
> it
Multiple ways to do this. We have a modified logic example that does this
without using celleditors. The code is unreleased so far.
> 3/ The text would all be in the same font (although if different fonts are
> possible within the other constraints presented here, please tell me how!)
Use a FlowPage, with InlineFlow and TextFlow figures to manage the nested
styles.
> 4/ The text would wrap-to-next-line within the rectangle width
org.eclipse.draw2d.text package handles this.
> 5/ The text may have newlines in it (in which case new paragraph starts as
> is usual)
ParagraphLayout handles this too.
> 6/ The text would get a vertical scrollbar if it exceeds the rectangle
> height (and of course scrollbar would disappear if resized rectangle
> accommodates entire text)
You'd have to put everything inside a scrollpane figure.
> 7/ Ideally, if the focus is not on a particular rectangle, a click to its
> text would place the cursor immediately at the text position clicked on
> (unlike the "flow" example in which the first click causes the entire text
> to be selected).
This is planned for 3.2 as well.
> Is there a class available which incorporates the rectangle *and* the
> contained text... or is it better to keep the rectangle separate from the
> contents, maybe for the purpose of controlling the positions of the
> handles on it?
FlowPage and BlockFlows in general support borders, although there is a
minor bug in 3.1 which was fixed in HEAD. If you just need a rectangle and
for the text to be placed inside, you could use borders. The correct place
to use the border might be at the scrollpane.
|
|
|
Re: "Shapes" enhancement [message #207768 is a reply to message #206234] |
Sat, 21 January 2006 00:15 |
Eclipse User |
|
|
|
Originally posted by: Vincent.Black.evhr.net
Hello, this post is very interesting, it could be a solution for my
previous question. What is the solution to don't use cell editor? Have oyu
a simple exemple?
Thank you !
Vincent
|
|
|
Powered by
FUDForum. Page generated in 0.27645 seconds