Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [bpel-dev] Simplify expression editors?

Because there's something really strange going on:

consider a modified version of ExpressionAssignCategory, say
AbstractExpressionAssignCategory, with these methods (which you see
delegates to the abstract method createStyledText)

	@Override
	protected void createClient(Composite parent) {
		// The top
		this.fEditorArea = getWidgetFactory().createComposite( parent );
		this.fEditorArea.setLayout( new GridLayout());

		// SKIPPED...

		this.expressionText = createStyledText(editor);
		this.expressionText.addModifyListener( new ModifyListener() {
			@Override
			public void modifyText( ModifyEvent e ) {
				saveExpressionToModel();
			}
		});
	}

	/**
	 * @param styledTextComposite
	 *            the Composite for the StyledText
	 * @return the created and configured StyledText based on an {@link
EmbeddedEditor}
	 */
	protected abstract StyledText createStyledText(Composite
styledTextComposite);

Now, if I write a concrete subclass with only the implementation of
createStyledText I get at some point this exception

java.lang.ClassCastException: org.eclipse.swt.layout.GridData cannot be
cast to org.eclipse.swt.layout.FillData

if I copy the inherited createClient in the subclass, everything works!

so I was wondering whether that methods was a hack due to something
misterious going on in the presence of subclasses?!

cheers
	Lorenzo


On 10/15/2012 05:10 PM, Vincent Zurczak wrote:
> Hi lorenzo,
> 
> Sorry, I cannot help on this.
> This is part of the legacy code of the editor.
> 
> The original code was written for Eclipse 2.x.
> I am not even sure this workaround is required anymore.
> 
> Regards,
> 
>                  Vincent.
> 
> 
> Le 15/10/2012 16:52, Lorenzo Bettini a écrit :
>> Hi
>>
>> can anyone tell me the meaning of this method in ExpressionAssignCategory?
>>
>> 	/*
>> 	 * (non-Javadoc)
>> 	 * @see org.eclipse.bpel.ui.properties.ExpressionSection
>> 	 * #createClient(org.eclipse.swt.widgets.Composite)
>> 	 */
>> 	@Override
>> 	protected final void createClient(Composite parent) {
>> 		// ugly HACK to make subclasses work
>> 		//FlatFormLayout layout = new FlatFormLayout();
>> 		//layout.marginHeight = layout.marginWidth = 0;
>> 		//parent.setLayout(layout);
>> 		FillLayout fillLayout = new FillLayout();
>> 		fillLayout.marginHeight = fillLayout.marginWidth = 0;
>> 		parent.setLayout(fillLayout);
>> 		super.createClient(parent);
>> 	}
>>
>> I'm writing some subclasses and it looks like there are problems with
>> layout if I do not redefine this createClient method...
>>
>> thanks
>> 	Lorenzo
> 
> -- 
> Vincent Zurczak
> 
> Eclipse RCP Developer & Petals ESB Consultant
> Phone: +33 (0) 6 40 28 86 57
> 
> Linagora: www.linagora.com <http://www.linagora.com/>
> Petals Link: www.petalslink.com <http://www.petalslink.com>
> 
> lol <https://twitter.com/VincentZurczak> Vincent Zurczak @ LinkedIn
> <http://fr.linkedin.com/pub/vincent-zurczak/18/b35/6a7> My Skype ID
> <callto://vincent.zurczak> My English blog <http://vzurczak.wordpress.com>
> 
> 
> _______________________________________________
> bpel-dev mailing list
> bpel-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/bpel-dev
> 


-- 
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Back to the top