Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Re: Enable propertyPage for UML Model
Re: Enable propertyPage for UML Model [message #479746] Wed, 12 August 2009 10:44 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
John,

This seems to be a general Eclipse UI extension questions that I know
nothing about. maybe someone on the platform newsgroup would have some
ideas, so I've added it to the "to" list of this reply.


John wrote:
> Hi,
> Using RSA v7.5.2 and am having trouble contributing a propertypage for
> an open UML model.
> Tried com.ibm.xtools.uml.navigator.ModelServerElement in the
> objectClass(see example below).
> This works fine but also presents the propertpage for any element
> selected within the model.
>
> Also tried *.emx in the nameFilter but the page is only presented when
> the unopened model is selected!
>
> Have also tried <filter name="umlType" value="Model"/> to no avail.
>
> Have also tried <enabledWhen>
> <adapt type="org.eclipse.uml2.uml.Model"></adapt>
> </enabledWhen>
>
> Would be grateful for any help.
>
> <extension point="org.eclipse.ui.propertyPages">
> <page class="mYPropertyPage" id="mYPropertyPage" name="mYPropertyPage"
> objectClass="com.ibm.xtools.uml.navigator.ModelServerElement "/>
> </extension>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Enable propertyPage for UML Model [message #479774 is a reply to message #479746] Wed, 12 August 2009 13:23 Go to previous messageGo to next message
John  is currently offline John Friend
Messages: 10
Registered: August 2009
Junior Member
Managed to get this working by using the propertyTester extension.

This seems to be a long way to do this and possibly even the wrong way -
but it works!

<extension point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="myClass.ModelPropertyTester"
id="myID.propertyTester"
namespace="myNameSpace.properties"
properties="isModel"
type="java.lang.Object">
</propertyTester>
</extension>

<extension point="org.eclipse.ui.propertyPages">
...
<enabledWhen>
<test
forcePluginActivation="true"
property="myNameSpace.isModel"
value="true">
</test>
</enabledWhen>
...
</extension>


code in "myClass.ModelPropertyTester"
public class ModelPropertyTester extends PropertyTester {

public boolean test(Object receiver,
String property,
Object[] args,
Object expectedValue) {

boolean result = false;

if (property.equalsIgnoreCase("isModel")){

if(receiver instanceof ModelServerElement){

ModelServerElement modelServerElement =
(ModelServerElement)receiver;

if (modelServerElement.getElement() instanceof Model) {
result = true;
}

}

}

return result;
}
}
Re: Enable propertyPage for UML Model [message #479781 is a reply to message #479774] Wed, 12 August 2009 13:46 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I'm not sure why it works, but it doesn't look like it should. You define:
namespace="myNameSpace.properties"
properties="isModel"

and then use it as:
property="myNameSpace.isModel"

except your property tester is myNameSpace.properties.isModel

PW


Re: Enable propertyPage for UML Model [message #480766 is a reply to message #479781] Tue, 18 August 2009 12:43 Go to previous message
John  is currently offline John Friend
Messages: 10
Registered: August 2009
Junior Member
Paul,
Apologies for that mistake and the delay in responding.

The line
namespace="myNameSpace.properties"

should be
namespace="myNameSpace"
Previous Topic:3.6 I-Build update site not working
Next Topic:How To Hide Resources From The Package Explorer After Creating Them
Goto Forum:
  


Current Time: Thu Apr 18 23:03:25 GMT 2024

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

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

Back to the top