|
Re: tabitem features [message #99550 is a reply to message #99376] |
Wed, 23 July 2008 11:38 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
I just checked with SWT. Right-Click (Mouse-Event) on TabItem are not
provided in SWT and will therefore not work in RWT, too. But maybe a
mouse listener on the TabFolder like in the following snippet does the
trick:
final Label[] label = new Label[ 1 ];
folder.addListener( SWT.MouseDown, new Listener() {
public void handleEvent( Event event ) {
if( label[ 0 ] != null ) {
label[ 0 ].dispose();
label[ 0 ] = null;
}
if( event.button == 3 ) {
label[ 0 ] = new Label( parent, SWT.NONE );
label[ 0 ].setText( "here we are: " + folder.getSelection()[ 0
].getText() );
label[ 0 ].pack();
label[ 0 ].setLocation( event.x, event.y );
label[ 0 ].moveAbove( folder );
}
}
});
folder.addListener( SWT.MouseUp, new Listener() {
public void handleEvent( Event event ) {
if( label[ 0 ] != null ) {
label[ 0 ].dispose();
label[ 0 ] = null;
}
}
});
Right mouse button down on the tabItem shows a label, mouse up removes
it.
Regarding decorators I'm not sure what you mean - decorators for TabItem
or decorators for text or images in general? The latter for example is
provided by DecorationOverlayIcon in the jface bundle.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Emmanuel [mailto:emmanuel.marchal@n-side.be]
Bereitgestellt: Dienstag, 22. Juli 2008 15:47
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: tabitem features
Betreff: tabitem features
Hi,
I was wondering if there are any plans to implement decorators and
right-click menu on tabitem ?
thanks,
Emmanuel
|
|
|
|
Re: tabitem features [message #100519 is a reply to message #100202] |
Tue, 29 July 2008 08:31 |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
regarding decorators, I didn't work with
DecorationOverlayIcon#createImage() yet, but I would give it a try. Once
created you can set the overlay image to the tabitem instance.
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Emmanuel [mailto:emmanuel.marchal@n-side.be]
Bereitgestellt: Freitag, 25. Juli 2008 14:32
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: tabitem features
Betreff: Re: tabitem features
Hi, thanks for the snippet and your answers.
Is there any reasons why Menu was not implemented in SWT ? Could we hope
to have it in the future ?
About decorators, I already use them in a treeviewer. I have created an
decorator extension point with a enablement for a particular class that
I
use in the content provider of my treeviewer. I also use the default
labelDecorator as decorator for this treeviewer
(PlatformUI.getWorkbench().getDecoratorManager().getLabelDec orator()).
I would like to the same with TabItems. But there is neither content
provider, nor labelDecorator in TabFolder. So my question is : how can I
decorate tabitem images ?
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.03139 seconds