I've though that I would listen from my module the event that invokes setTarget of PropPanel.class. Then I change the original UmlPackage properties panel by the Layer properties panel. Is this possible? and, how I could do it exactly?
Regards.
2006/6/22, Tom Morris <[EMAIL PROTECTED]>:
I think the original question was how do you get one prop panel used for
<<layer>> Package (a Package with the <<layer>> stereotype applied) and a
different prop panel for any other type of Package.
I don't know the answer off the top of my head, but it wouldn't surprise me
to find that the answer is that you can't without modifying the ArgoUML
core.
Based on the code snippets that Bob posted, you might be able to get the
previously registered standard property panel and save it, then register
your own to replace it and then forward any actions which are Packages which
are not <<layer>> Packages. I have no idea if this would work though.
Tom
> -----Original Message-----
> From: Bob Tarling [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 22, 2006 12:50 PM
> To: [email protected]
> Subject: Re: [argouml-dev] Property Panels
>
>
> If you've registered your panel as I described then you
> should have called this method int TabProps.
>
> public void addPanel(Class c, PropPanel p) {
> panels.put(c, p);
> }
>
> As you can see all that does is to add your panel to a
> hashtable index by the class.
>
> When ArgoUML later tries to display the correct panel it's
> using this code to pull out the panel from the above hastable
> according to the class.
>
> private TabModelTarget findPanelFor(Object trgt) {
> /* 1st attempt: get a panel that we created before: */
> TabModelTarget p = (TabModelTarget)
> panels.get(trgt.getClass());
> if (p != null) {
> LOG.debug ("Getting prop panel for: " +
> trgt.getClass().getName()
> + ", " + "found (in cache?) " + p);
> return p;
> }
>
> So my first thought is you are not registering the class name
> correctly.
>
> If that's not the case then could you tell me what debug is
> appearing in the log at this time.
>
> Cheers
>
> Bob.
>
>
> On 6/22/06, Agustín Marín Ortega < [EMAIL PROTECTED]> wrote:
> > Hello, I'm Agustín Marín, thanks for help me. My diagrams
> properties
> > panels are being loaded rightly, but now I've problems with my
> > elements properties panels.
> >
> > We have implemented a metamodel based in a profile of
> original macmas
> > metatypes, e.g., we have an element called Layer that really is a
> > stereotyped UMLPackage. The problem is that when the TargetManager
> > request for a properties panel for our Layer elements the class
> > PropPanel returns the panel of the original UMLPackage element
> > (UMLPackagePanel) instead of our LayerPanel.
> >
> > The logic in this class only consider the original class of the
> > metamodel element selected and we can't insert additional logic to
> > support the correct code because we work from a separate argouml
> > module. As you can seen, we also can't change our element metatypes
> > because this implies to lost the original MOF UML persistence
> > supported by ArgoUML, that is the main reason to use the
> UML Profile
> > mechanism.
> >
> > What can we do, any idea? Regards.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
