Accelerate Keys of Text control do not work in MultipageEditorPart [message #252202] |
Mon, 14 June 2004 04:16  |
Eclipse User |
|
|
|
I created a page (a Composit) in MultipageEditorPart, and added some Text to
the page. But "CTRL+C", "CTRL+V" and other accelerate keys do not work on
the Texts I added. Why?
And it is wierd that it works well when right clicking the mouse, and choose
"Copy"/"Paste" on the popup menu.
What should I do to make those Texts respond to key events?
Thanks!
|
|
|
|
Re: Accelerate Keys of Text control do not work in MultipageEditorPart [message #252555 is a reply to message #252420] |
Mon, 14 June 2004 21:20   |
Eclipse User |
|
|
|
Followed is the sample code. Accelerate keys do not work on "userText", but
the popup menu when right clicking the mouse can work.
---------------------------------------------------
public class TestEditor
extends MultiPageEditorPart
implements IEditingDomainProvider, ISelectionProvider, IMenuListener
{
...
public void createPages()
{
Composite composite = new Composite(getContainer(), SWT.NONE);
GridLayout layout = new GridLayout();
composite.setLayout(layout);
layout.numColumns = 2;
userText = new Text(composite, SWT.BORDER);
userText.setVisible(true);
userText.setEnabled(true);
int index = addPage(composite);
setPageText(index, "MyPage");
setActivePage(index);
}
...
}
----------------------------------------------------------
"Douglas Pollock" <douglas.pollock@magma.ca> wrote in message
news:caks1c$1do$2@eclipse.org...
> eclipse.platform wrote:
> > I created a page (a Composit) in MultipageEditorPart, and added some
Text
> > to the page. But "CTRL+C", "CTRL+V" and other accelerate keys do not
work
> > on the Texts I added. Why?
> > And it is wierd that it works well when right clicking the mouse, and
> > choose "Copy"/"Paste" on the popup menu.
> > What should I do to make those Texts respond to key events?
>
> Could you please attach some sample code showing the problem?
>
>
>
> cheers,
> d.
|
|
|
Re: Accelerate Keys (CTRL+C,CTRL+V,CTRL+X) of Text widget do not work in MultipageEditorPart [message #252949 is a reply to message #252555] |
Tue, 15 June 2004 22:42   |
Eclipse User |
|
|
|
Can somebody help? The original code is generated by EMF. What should do?
Should I add keylistener to the Text widget? But I think there must be a
simple way to do this, because accelerate keys are automatically enabled
when create a Text widget in a shell or WizardPage. How come it doesn't work
in MultipageEditorPart?
"Hank" <hzhou@actuate.com> wrote in message news:calicn$qfl$1@eclipse.org...
> Followed is the sample code. Accelerate keys do not work on "userText",
but
> the popup menu when right clicking the mouse can work.
> ---------------------------------------------------
> public class TestEditor
> extends MultiPageEditorPart
> implements IEditingDomainProvider, ISelectionProvider, IMenuListener
> {
> Text userText;
> ...
> public void createPages()
> {
> Composite composite = new Composite(getContainer(), SWT.NONE);
> GridLayout layout = new GridLayout();
> composite.setLayout(layout);
> layout.numColumns = 2;
>
> userText = new Text(composite, SWT.BORDER);
> userText.setVisible(true);
> userText.setEnabled(true);
> int index = addPage(composite);
> setPageText(index, "MyPage");
> setActivePage(index);
> }
> ...
> }
> ----------------------------------------------------------
>
> "Douglas Pollock" <douglas.pollock@magma.ca> wrote in message
> news:caks1c$1do$2@eclipse.org...
> > eclipse.platform wrote:
> > > I created a page (a Composit) in MultipageEditorPart, and added some
> Text
> > > to the page. But "CTRL+C", "CTRL+V" and other accelerate keys do not
> work
> > > on the Texts I added. Why?
> > > And it is wierd that it works well when right clicking the mouse, and
> > > choose "Copy"/"Paste" on the popup menu.
> > > What should I do to make those Texts respond to key events?
> >
> > Could you please attach some sample code showing the problem?
> >
> >
> >
> > cheers,
> > d.
>
>
|
|
|
Re: Accelerate Keys (CTRL+C,CTRL+V,CTRL+X) of Text widget do not work in MultipageEditorPart [message #256824 is a reply to message #252949] |
Tue, 29 June 2004 15:10  |
Eclipse User |
|
|
|
Originally posted by: douglas.pollock.magma.ca
Hank wrote:
> Can somebody help? The original code is generated by EMF. What should do?
> Should I add keylistener to the Text widget? But I think there must be a
> simple way to do this, because accelerate keys are automatically enabled
> when create a Text widget in a shell or WizardPage. How come it doesn't
> work in MultipageEditorPart?
First of all, make sure you are using Eclipse 3.0.
Secondly, you should probably run a self-hosted session with the tracing
options for "org.eclipse.ui" turned on. Specifically, contexts, key
bindings and handlers (commandId="org.eclipse.ui.edit.cut"). This will
tell you exactly what is happening. You should expect to see a
HandlerProxy getting called when you press "Ctrl+C", but I imagine you will
see an ActionHandler.
In this case, a handler is probably being registered by one of the
contributors but never unregistered. The multi-page editor part is smart
enough to deal with actions registered through the site, but not through
the contributor.
An excellent example of MultiPageEditor code is PDE forms work.
cheers,
d.
|
|
|
Powered by
FUDForum. Page generated in 0.45522 seconds