| 
						
					 | 
					 | 
					@@ -20,11 +20,13 @@ import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.eclipse.e4.ui.workbench.modeling.EModelService;
 | 
					 | 
					 | 
					 | 
					import org.eclipse.e4.ui.workbench.modeling.EModelService;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.eclipse.jface.viewers.ISelection;
 | 
					 | 
					 | 
					 | 
					import org.eclipse.jface.viewers.ISelection;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.eclipse.jface.viewers.IStructuredSelection;
 | 
					 | 
					 | 
					 | 
					import org.eclipse.jface.viewers.IStructuredSelection;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import org.eclipse.osgi.util.NLS;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.BitVector;
 | 
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.BitVector;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.DoubleVal;
 | 
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.DoubleVal;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.WaveformType;
 | 
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.WaveformType;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.ui.TrackEntry;
 | 
					 | 
					 | 
					 | 
					import com.minres.scviewer.database.ui.TrackEntry;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.minres.scviewer.e4.application.Messages;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.minres.scviewer.e4.application.parts.WaveformViewer;
 | 
					 | 
					 | 
					 | 
					import com.minres.scviewer.e4.application.parts.WaveformViewer;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					public class WaveformPopupMenuContribution {
 | 
					 | 
					 | 
					 | 
					public class WaveformPopupMenuContribution {
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -86,14 +88,15 @@ public class WaveformPopupMenuContribution {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								ISelection sel = wfv.getSelection();
 | 
					 | 
					 | 
					 | 
								ISelection sel = wfv.getSelection();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								TrackEntry elem = getSingleTrackEntry(sel);
 | 
					 | 
					 | 
					 | 
								TrackEntry elem = getSingleTrackEntry(sel);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if(selHasBitVector(sel, false)) {
 | 
					 | 
					 | 
					 | 
								if(selHasBitVector(sel, false)) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, "hex", TrackEntry.ValueDisplay.DEFAULT, elem);
 | 
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_0, TrackEntry.ValueDisplay.BINARY, elem);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, "unsigned", TrackEntry.ValueDisplay.UNSIGNED, elem);
 | 
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_1, TrackEntry.ValueDisplay.DEFAULT, elem);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, "signed", TrackEntry.ValueDisplay.SIGNED, elem);
 | 
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_2, TrackEntry.ValueDisplay.UNSIGNED, elem);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									addValueMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_3, TrackEntry.ValueDisplay.SIGNED, elem);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									items.add(MMenuFactory.INSTANCE.createMenuSeparator());
 | 
					 | 
					 | 
					 | 
									items.add(MMenuFactory.INSTANCE.createMenuSeparator());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									addWaveMenuItem(items, application, modelService, "bit vector", TrackEntry.WaveDisplay.DEFAULT, elem);
 | 
					 | 
					 | 
					 | 
									addWaveMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_4, TrackEntry.WaveDisplay.DEFAULT, elem);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}						
 | 
					 | 
					 | 
					 | 
								}						
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								addWaveMenuItem(items, application, modelService, "analog step-wise", TrackEntry.WaveDisplay.STEP_WISE, elem);
 | 
					 | 
					 | 
					 | 
								addWaveMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_5, TrackEntry.WaveDisplay.STEP_WISE, elem);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								addWaveMenuItem(items, application, modelService, "analog continous", TrackEntry.WaveDisplay.CONTINOUS, elem);
 | 
					 | 
					 | 
					 | 
								addWaveMenuItem(items, application, modelService, Messages.WaveformPopupMenuContribution_6, TrackEntry.WaveDisplay.CONTINOUS, elem);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -102,13 +105,13 @@ public class WaveformPopupMenuContribution {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
 | 
					 | 
					 | 
					 | 
							MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setType(ItemType.RADIO);
 | 
					 | 
					 | 
					 | 
							item.setType(ItemType.RADIO);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setSelected(elem != null && elem.valueDisplay == value);
 | 
					 | 
					 | 
					 | 
							item.setSelected(elem != null && elem.valueDisplay == value);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setLabel("Show as "+label);
 | 
					 | 
					 | 
					 | 
							item.setLabel(NLS.bind(Messages.WaveformPopupMenuContribution_7, label));
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application");
 | 
					 | 
					 | 
					 | 
							item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); //$NON-NLS-1$
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							List<MCommand> cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changevaluedisplay", MCommand.class, null);
 | 
					 | 
					 | 
					 | 
							List<MCommand> cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changevaluedisplay", MCommand.class, null); //$NON-NLS-1$
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if(cmds.size()!=1) System.err.println("No command found!");
 | 
					 | 
					 | 
					 | 
							if(cmds.size()!=1) System.err.println(Messages.WaveformPopupMenuContribution_10);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							else item.setCommand(cmds.get(0));
 | 
					 | 
					 | 
					 | 
							else item.setCommand(cmds.get(0));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							MParameter param = MCommandsFactory.INSTANCE.createParameter();
 | 
					 | 
					 | 
					 | 
							MParameter param = MCommandsFactory.INSTANCE.createParameter();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							param.setName("com.minres.scviewer.e4.application.commandparameter.changevaluedisplay");
 | 
					 | 
					 | 
					 | 
							param.setName("com.minres.scviewer.e4.application.commandparameter.changevaluedisplay"); //$NON-NLS-1$
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							param.setValue(value.toString());
 | 
					 | 
					 | 
					 | 
							param.setValue(value.toString());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.getParameters().add(param);
 | 
					 | 
					 | 
					 | 
							item.getParameters().add(param);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							items.add(item);
 | 
					 | 
					 | 
					 | 
							items.add(item);
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -119,13 +122,13 @@ public class WaveformPopupMenuContribution {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
 | 
					 | 
					 | 
					 | 
							MHandledMenuItem item = MMenuFactory.INSTANCE.createHandledMenuItem();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setType(ItemType.RADIO);
 | 
					 | 
					 | 
					 | 
							item.setType(ItemType.RADIO);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setSelected(elem != null && elem.waveDisplay==value);
 | 
					 | 
					 | 
					 | 
							item.setSelected(elem != null && elem.waveDisplay==value);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setLabel("Render "+label);
 | 
					 | 
					 | 
					 | 
							item.setLabel(NLS.bind(Messages.WaveformPopupMenuContribution_12, label));
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application");
 | 
					 | 
					 | 
					 | 
							item.setContributorURI("platform:/plugin/com.minres.scviewer.e4.application"); //$NON-NLS-1$
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							List<MCommand> cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changewavedisplay", MCommand.class, null);
 | 
					 | 
					 | 
					 | 
							List<MCommand> cmds = modelService.findElements(application, "com.minres.scviewer.e4.application.command.changewavedisplay", MCommand.class, null); //$NON-NLS-1$
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if(cmds.size()!=1) System.err.println("No command found!");
 | 
					 | 
					 | 
					 | 
							if(cmds.size()!=1) System.err.println(Messages.WaveformPopupMenuContribution_15);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							else item.setCommand(cmds.get(0));
 | 
					 | 
					 | 
					 | 
							else item.setCommand(cmds.get(0));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							MParameter param = MCommandsFactory.INSTANCE.createParameter();
 | 
					 | 
					 | 
					 | 
							MParameter param = MCommandsFactory.INSTANCE.createParameter();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							param.setName("com.minres.scviewer.e4.application.commandparameter.changewavedisplay");
 | 
					 | 
					 | 
					 | 
							param.setName("com.minres.scviewer.e4.application.commandparameter.changewavedisplay"); //$NON-NLS-1$
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							param.setValue(value.toString());
 | 
					 | 
					 | 
					 | 
							param.setValue(value.toString());
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							item.getParameters().add(param);
 | 
					 | 
					 | 
					 | 
							item.getParameters().add(param);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							items.add(item);
 | 
					 | 
					 | 
					 | 
							items.add(item);
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					 
 |