Label +DirectEdit gives ClassCastException [message #137474] |
Thu, 10 June 2004 06:01  |
Eclipse User |
|
|
|
Originally posted by: niek_verdoes.quicknet.nl
Hi,
I have a problem and I can't find what it is. We used the Logic editor to
build our own.
We have a figure called Feature with two labels in it. I wan't to be able to
edit it through a Direct Edit Role.
But when I run the plugin, and I select a label, I get a ClassCastException.
I followed the redBook steps, and use the logic edit parts.
This is my code:
(in the FeatureEditPart.java)
private void performDirectEdit(){
if(manager == null)
manager = new LogicLabelEditManager(this,
TextCellEditor.class, new
LabelCellEditorLocator((Label)getFigure()));
manager.show();
}
and in FeatureFigure.java:
public FeatureFigure() {
setBorder(new FeatureBorder());
ToolbarLayout layout = new ToolbarLayout();
layout.setSpacing(10);
setLayoutManager(layout);
Label title = new Label("Titel");
title.setFont(new Font(null, "Arial", 12, SWT.BOLD));
Label text = new Label("Default text");
add(title);
add(text);
..
}
What could I be doing wrong?
|
|
|
Re: Label +DirectEdit gives ClassCastException [message #137625 is a reply to message #137474] |
Thu, 10 June 2004 13:07  |
Eclipse User |
|
|
|
Did you look at the stack trace? Go to Window -> Show View -> Other -> PDE
Runtime -> Error Log in your runtime workbench.
"Niek Verdoes" <niek_verdoes@quicknet.nl> wrote in message
news:ca9b2b$pke$1@eclipse.org...
> Hi,
>
> I have a problem and I can't find what it is. We used the Logic editor to
> build our own.
> We have a figure called Feature with two labels in it. I wan't to be able
to
> edit it through a Direct Edit Role.
> But when I run the plugin, and I select a label, I get a
ClassCastException.
> I followed the redBook steps, and use the logic edit parts.
> This is my code:
>
> (in the FeatureEditPart.java)
>
> private void performDirectEdit(){
> if(manager == null)
> manager = new LogicLabelEditManager(this,
> TextCellEditor.class, new
> LabelCellEditorLocator((Label)getFigure()));
> manager.show();
> }
>
> and in FeatureFigure.java:
>
> public FeatureFigure() {
> setBorder(new FeatureBorder());
> ToolbarLayout layout = new ToolbarLayout();
> layout.setSpacing(10);
> setLayoutManager(layout);
> Label title = new Label("Titel");
> title.setFont(new Font(null, "Arial", 12, SWT.BOLD));
> Label text = new Label("Default text");
> add(title);
> add(text);
> ..
> }
>
> What could I be doing wrong?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02395 seconds