4 package eu
.etaxonomy
.taxeditor
.forms
.entitysections
;
6 import org
.eclipse
.jface
.action
.Action
;
7 import org
.eclipse
.jface
.action
.IAction
;
8 import org
.eclipse
.swt
.events
.SelectionAdapter
;
9 import org
.eclipse
.swt
.events
.SelectionEvent
;
10 import org
.eclipse
.swt
.widgets
.Composite
;
12 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
13 import eu
.etaxonomy
.cdm
.model
.media
.Rights
;
19 public class RightsSection
extends AbstractEntitySetSection
<IdentifiableEntity
> {
26 protected RightsSection(Composite parent
, IdentifiableEntity entity
,
28 super(parent
, entity
, style
);
33 * @see eu.etaxonomy.taxeditor.forms.AbstractEntitySetSection#createDynamicContents()
36 protected void createDynamicContents() {
37 // TODO Auto-generated method stub
41 private class RemoveListener
extends SelectionAdapter
{
42 private Rights rights
;
44 public RemoveListener(Rights rights
){
49 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
52 public void widgetSelected(SelectionEvent e
) {
53 getEntity().removeRights(rights
);
54 internalUpdateSection(true);
59 * @see eu.etaxonomy.taxeditor.forms.AbstractEntitySetSection#getAddAction()
62 protected IAction
getAddAction() {
63 Action addRights
= new Action("add", Action
.AS_PUSH_BUTTON
){
65 * @see org.eclipse.jface.action.Action#run()
69 Rights rights
= Rights
.NewInstance();
70 getEntity().addRights(rights
);
71 internalUpdateSection(true);
72 if(! getSection().isExpanded())
73 getSection().setExpanded(true);
74 internalUpdateSection(true);
77 addRights
.setToolTipText("Create a new marker");