Project

General

Profile

« Previous | Next » 

Revision e1fa7fbe

Added by Patrick Plitzner almost 7 years ago

fix #6669 Refresh context menu before it is drawn

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java
47 47
 * @created Jan 24, 2011
48 48
 * @version 1.0
49 49
 */
50
public class ConceptViewPart extends AbstractCdmEditorViewPart 
50
public class ConceptViewPart extends AbstractCdmEditorViewPart
51 51
implements IPartContentHasDetails, IPartContentHasSupplementalData{
52 52

  
53 53
	public static final String ID = "eu.etaxonomy.taxeditor.editor.view.concept"; //$NON-NLS-1$
......
63 63
			showEmptyPage();
64 64
			return;
65 65
		}
66
		
66

  
67 67
        if (part instanceof DetailsViewPart || part instanceof SupplementalDataViewPart) {
68 68
            // do not show empty page as these views are also used to edit the
69 69
            // description selected in this view
......
93 93
		}
94 94

  
95 95
	}
96
	
96

  
97 97
	@Override
98 98
	protected String createPartTitle(Object selectedObject) {
99 99
		if(selectedObject instanceof TaxonEditorInput){
......
135 135

  
136 136
		Control control = viewer.getControl();
137 137
		Menu menu = menuManager.createContextMenu(control);
138
		menuManager.setRemoveAllWhenShown(true);
138 139

  
139 140
		control.setMenu(menu);
140 141
	}
......
149 150

  
150 151
		public ConceptRelationViewer(Composite parent) {
151 152
			super(parent);
152
		} 
153
		
153
		}
154

  
154 155
		@Override
155 156
		public ISelection getSelection() {
156 157
			ISelection selection = super.getSelection();
......
158 159
				Object firstElement = ((IStructuredSelection) selection).getFirstElement();
159 160
				TaxonRelationship taxonRelationship = ((Entry<TaxonRelationship, Taxon>)firstElement).getKey();
160 161
				return new StructuredSelection(taxonRelationship);
161
				
162

  
162 163
			}
163 164
			return selection;
164 165
		}
165
		
166

  
166 167
		@Override
167 168
		public void setSelection(ISelection selection) {
168 169
			super.setSelection(selection);

Also available in: Unified diff