} else if (entity instanceof TaxonNodeAgentRelation) {
element = new TaxonNodeAgentRelationCollectionElement(this, parentElement, (TaxonNodeAgentRelation) entity, removeListener, backgroundColor, style);
}else if (entity instanceof Media) {
- element = new MediaMetaElement(this, parentElement, (Media) entity, removeListener, true, style);
+ element = new MediaMetaElement(this, parentElement, (Media) entity, removeListener, style);
} else if (entity instanceof MediaRepresentation) {
element = new MediaRepresentationElement(this, parentElement, (MediaRepresentation) entity, removeListener,
style);
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
private Color backgroundColor;
- public AbstractEntityCollectionElement(CdmFormFactory formFactory,
- AbstractFormSection section, ENTITY entity,
- SelectionListener removeListener, Color backgroundColor, int style) {
- this(formFactory, section, entity, removeListener, false, backgroundColor, style);
- }
public AbstractEntityCollectionElement(CdmFormFactory formFactory,
AbstractFormSection section, ENTITY entity, SelectionListener removeListener,
- boolean isChoosableEntity, Color backgroundColor, int style) {
+ Color backgroundColor, int style) {
super(formFactory, (ICdmFormElement) section);
this.entity = entity;
container.setLayout(containerLayout);
container.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
- if(isChoosableEntity){
- btnChooseEntity = formFactory.createButton(box, null, SWT.PUSH);
- addControl(btnChooseEntity);
-
- btnChooseEntity.setLayoutData(LayoutConstants.RIGHT());
- btnChooseEntity.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
- btnChooseEntity.setToolTipText("Browse");
- btnChooseEntity.addListener(SWT.Selection, new Listener() {
-
- @Override
- public void handleEvent(Event event) {
- ENTITY entity = selectFromDialog();
- if(entity!=null){
- if(getParentElement() instanceof AbstractEntityCollectionSection){
- ((AbstractEntityCollectionSection)getParentElement()).removeElement(getEntity());
- ((AbstractEntityCollectionSection)getParentElement()).addElement(entity);
- }
- firePropertyChangeEvent(this);
- }
- }
- });
- }
-
if (removeListener != null) {
btnRemove = formFactory.createButton(box, null, SWT.PUSH);
addControl(btnRemove);
public MediaMetaElement(CdmFormFactory cdmFormFactory,
AbstractFormSection<?> formElement, Media element,
- SelectionListener removeListener, boolean isChoosableEntity, int style) {
- super(cdmFormFactory, formElement, element, removeListener, isChoosableEntity, null, style);
+ SelectionListener removeListener, int style) {
+ super(cdmFormFactory, formElement, element, removeListener, null, style);
//make element selectable
if(cdmFormFactory.getSelectionProvider() != null){
selectionArbitrator = cdmFormFactory.createSelectionArbitrator(this);
}
-
-
+
+
}
/** {@inheritDoc} */
}
text_title.setLanguageString(title);
-
+
}
@Override
protected Media selectFromDialog() {
-
+
setEntity(MediaSelectionDialog.select(AbstractUtility.getShell(), null, null));
return entity;
}
*/
public MeasurementUnitCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, MeasurementUnit entity,
SelectionListener removeListener, Color backgroundColor, int style) {
- super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+ super(formFactory, section, entity, removeListener, backgroundColor, style);
}
*/
public RecommendedModifierVocabulariesElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabulary<DefinedTerm> entity,
SelectionListener removeListener, Color backgroundColor, int style) {
- super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+ super(formFactory, section, entity, removeListener, backgroundColor, style);
}
*/
public StateVocabularyCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, TermVocabulary<State> entity,
SelectionListener removeListener, Color backgroundColor, int style) {
- super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+ super(formFactory, section, entity, removeListener, backgroundColor, style);
}
*/
public StatisticalMeasureCollectionElement(CdmFormFactory formFactory, AbstractFormSection section, StatisticalMeasure entity,
SelectionListener removeListener, Color backgroundColor, int style) {
- super(formFactory, section, entity, removeListener, false, backgroundColor, style);
+ super(formFactory, section, entity, removeListener, backgroundColor, style);
}