Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to modify the properties page?.. Please help
How to modify the properties page?.. Please help [message #41766] Thu, 07 September 2006 07:28 Go to next message
Eclipse UserFriend
Originally posted by: vikas.goyal.hp.com

Hi,
If I want to modify the property view of the GMF editor. How can I do
it? I would like to add an additional column here and populate the values.
for example: If I have an element like the following:

<NodeA employeeid="abc" customizable="true"/>


In property view i want this to be shown as follows: Label Header should
be as follows:
Attribute Name Value Modifable

employeeid abc true (drop down box)

Here I would like to shown the attribute employeeid and its value "abc" to
be displayed along with the value of customizable. I want to display only
the value of the customizable attribute.


Please suggest ...

Thanks & regards
Vikas
Re: How to modify the properties page?.. Please help [message #43853 is a reply to message #41766] Sun, 10 September 2006 08:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a318mb.gmail.com

Hi.

See group eclipse.tools.emf

Example -
http://dev.eclipse.org/newslists/news.eclipse.tools.emf/msg1 8913.html

For gmf find and override ...

package xxxxxx.diagram.providers

public class XXXXXPropertyProvider extends GenericEMFPropertiesProvider

@Override

protected ICompositePropertySource createPropertySource(Object object,
IItemPropertySource itemPropertySource) {

if (object instanceof XXXXXImpl) return new
XXXXXXPropertySource(object,itemPropertySource, "MYGROUP"); //$NON-NLS-1$}

}

package xxxx.diagram.providers;

import
org.eclipse.gmf.runtime.emf.ui.properties.descriptors.EMFCom positePropertySo
urce

import ...

public class XXXXPropertySource extends EMFCompositePropertySource {

@Override

protected IPropertyDescriptor newPropertyDescriptor(IItemPropertyDescriptor
itemPropertyDescriptor) {

return new XXXXSourcePropertyDescriptor(object, itemPropertyDescriptor,
getCategory());

}

}

package XXXXX.diagram.providers;

import
org.eclipse.gmf.runtime.emf.ui.properties.descriptors.EMFCom positeSourceProp
ertyDescriptor

import ...

public class XXXXXSourcePropertyDescriptor extends
EMFCompositeSourcePropertyDescriptor {

@Override

protected CellEditor doCreateEditor(Composite composite) {

Object genericFeature = getFeature();

if (object instanceof MyFeature) {

MyDialogCellEditor cellEditor = new MyDialogCellEditor(composite){

protected void focusLost() {

if (isActivated()) { deactivate(); }

}

};

return cellEditor;

}

return super.doCreateEditor(composite);

}

}

package....

import org.eclipse.jface.viewers.DialogCellEditor;

import....

public class MyDialogCellEditor extends DialogCellEditor {

@Override

protected Object openDialogBox(Control cellEditorWindow) {

//TODO show dialog return new vaule

}

}
Re: How to modify the properties page?.. Please help [message #60619 is a reply to message #43853] Tue, 10 October 2006 06:01 Go to previous message
Eclipse UserFriend
Hi Mishael,

I just tried your proposal. Looks like it works quite well. But as I'm
totally new with writing my own Properties-view I'm not sure about some
things happening. Could you please give some more explanations?

1. in 'Take control of your properties'-Paper the propertyDescriptors
are generated in the getPropertyDescriptors()-method. Why do I need to
override ...
> public class XXXXPropertySource extends EMFCompositePropertySource {
>
> @Override
>
> protected IPropertyDescriptor
newPropertyDescriptor(IItemPropertyDescriptor
> itemPropertyDescriptor) {
>
> return new XXXXSourcePropertyDescriptor(object,
itemPropertyDescriptor,
> getCategory());
??

2. What's the DialogCellEditor for? and why am I not able to edit my
Properties?

3. By now, the Properties are all added to the Advanced-Tab of the
Tabbed-Property-View. Is there a way to use the custom-properties in old
Properties-view? Or better: Do you know how to replace the
tabbed-Properties-View with the old one (table-properties with two
columns name-Value-Pairs)

It would be very nice of you if you could lighten up my
mysteries-clouded brain.

Thanks in advance
Alex
Previous Topic:Strange setScale() call in GMF generated code for createTargetDecoration()
Next Topic:Modular diagrams
Goto Forum:
  


Current Time: Sun Jul 27 00:30:06 EDT 2025

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

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

Back to the top