|
Revision 263, 1.0 kB
(checked in by arjanmol, 5 years ago)
|
*** empty log message ***
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
"""Operation item. |
|---|
| 3 |
""" |
|---|
| 4 |
|
|---|
| 5 |
import gobject |
|---|
| 6 |
import diacanvas |
|---|
| 7 |
from gaphor.diagram import initialize_item |
|---|
| 8 |
from feature import FeatureItem |
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
class OperationItem(FeatureItem): |
|---|
| 13 |
|
|---|
| 14 |
popup_menu = FeatureItem.popup_menu + ( |
|---|
| 15 |
'EditItem', |
|---|
| 16 |
'DeleteOperation', |
|---|
| 17 |
'separator', |
|---|
| 18 |
'CreateOperation' |
|---|
| 19 |
) |
|---|
| 20 |
|
|---|
| 21 |
def __init__(self, id=None): |
|---|
| 22 |
FeatureItem.__init__(self, id) |
|---|
| 23 |
|
|---|
| 24 |
def on_subject_notify(self, pspec, notifiers=()): |
|---|
| 25 |
FeatureItem.on_subject_notify(self, pspec, ('name', 'visibility') |
|---|
| 26 |
+ notifiers) |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
def on_subject_notify__name(self, subject, pspec): |
|---|
| 30 |
self._expression.set_text(self.subject.render()) |
|---|
| 31 |
self.request_update() |
|---|
| 32 |
|
|---|
| 33 |
on_subject_notify__visibility = on_subject_notify__name |
|---|
| 34 |
on_subject_notify__taggedValue_value = on_subject_notify__name |
|---|
| 35 |
|
|---|
| 36 |
initialize_item(OperationItem) |
|---|