Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Label +DirectEdit gives ClassCastException
Label +DirectEdit gives ClassCastException [message #137474] Thu, 10 June 2004 10:01 Go to next message
Eclipse UserFriend
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 17:07 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
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?
>
>
Previous Topic:EditPart layering reg.
Next Topic:JTable equivalent
Goto Forum:
  


Current Time: Fri Apr 26 06:33:20 GMT 2024

Powered by FUDForum. Page generated in 0.03670 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top