Search Mailing List Archives
[protege-discussion] Disable "delete class" item from menu
robber82 at email.it
robber82 at email.it
Thu Mar 20 02:03:24 PDT 2008
Thanks, I would also disable or delete the "delete class" item in
"popup menu", not only in headers button. Can you help me?
--------- Original Message -------- Da: "User support for Core
Protege and the Protege-Frames editor"
<protege-discussion at lists.stanford.edu> To: "User support for
Core Protege and the Protege-Frames editor"
<protege-discussion at lists.stanford.edu> Oggetto: Re:
[protege-discussion] Disable "delete class" item from menu Data:
18/03/08 22:27 I don't recommend that you modify the code of the
ClsesTab. Instead, I suggest that you build your own Tab widget and that
you reuse all the components from the classes tab. In this way you can
customize the UI and the behavior of the tab in any way you like. You can
start by subclassing edu.stanford.smi.protege.widget.ClsesTab, e.g.
let's say you call your class MyClsesTab. Then, you need to override
the method createClsesPanel() which creates the panel that holds the
classes tree and all the create and delete buttons. This method should
return a ClsesPanel. To remove or disable to delete button, subclass
ClsesPanel, say MyClsesPanel. The constructor of MyClsesPanel, should look
like: public MyClsesPanel(Project project) { super(project);
//this will remove the button with index 3 (the delete button)
_labeledComponent.removeHeaderButton(3); } Going back to the MyClsesTab,
the createClsesPanel() method should look like: protected ClsesPanel
createClsesPanel() { MyClsesPanel panel = new
MyClsesPanel(getProject()); panel.addSelectionListener(new
SelectionListener() { public void
selectionChanged(SelectionEvent event) {
transmitSelection(); } }); return panel; }
That's it. So, all you need to do is to override 2 methods the way that
I have described. You can also add more customization to your tab. To
enable your tab, go to Project ->Configure and select
"MyClsesTab". We have more documentation on building plugins
here: http://protege.stanford.edu/doc/dev.html Tania robber82 at email.it
wrote: > > Hi, How can I disable or delete the "delete
class" item from menu in > "subclass Explorer"? > Can
you help me? > Which class must I modify? > regards > > ----
> Email.it, the professional e-mail, gratis per te: clicca qui >
<http://www.email.it/cgi-bin/start?sid=3> > > Sponsor: >
Scopri le tue passioni con Leonardo.it! > Clicca qui
<http://adv.email.it/cgi-bin/foclick.cgi?mid=7614&d=20080317> >
> > ---- > Email.it, the professional e-mail, gratis per te: clicca
qui > <http://www.email.it/cgi-bin/start?sid=3> > > Sponsor:
> Scopri le tue passioni con Leonardo.it! > Clicca qui
<http://adv.email.it/cgi-bin/foclick.cgi?mid=7613&d=20080317> >
>
------------------------------------------------------------------------
> > _______________________________________________ >
protege-discussion mailing list > protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion >
> Instructions for unsubscribing:
http://protege.stanford.edu/doc/faq.html#01a.03 >
_______________________________________________ protege-discussion mailing
list protege-discussion at lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-discussion
Instructions for unsubscribing:
http://protege.stanford.edu/doc/faq.html#01a.03
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Scopri le tue passioni con Leonardo.it!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=7615&d=20080320
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20080320/ec3cae07/attachment.html>
More information about the protege-discussion
mailing list