debuggercdi/com.nokia.carbide.cpp.debug.kernelaware/src/com/nokia/carbide/cpp/debug/kernelaware/ui/SymbianOSView.java
changeset 20 5c466f93ffe1
parent 2 d760517a8095
equal deleted inserted replaced
19:95d8c60d963a 20:5c466f93ffe1
   164 	private boolean m_disposed;
   164 	private boolean m_disposed;
   165 
   165 
   166 	// Make this option static so that it's consistent across view sessions.
   166 	// Make this option static so that it's consistent across view sessions.
   167 	static boolean m_autoRefresh = true;
   167 	static boolean m_autoRefresh = true;
   168 
   168 
       
   169 	private TabFolder tabFolder;
       
   170 	
       
   171 	private int refreshCount;
       
   172 
   169 	/*
   173 	/*
   170 	 * (non-Javadoc)
   174 	 * (non-Javadoc)
   171 	 * 
   175 	 * 
   172 	 * @see com.freescale.cdt.debug.cw.core.ui.os.OSView#createPartControl(org.eclipse.swt.widgets.Composite)
   176 	 * @see com.freescale.cdt.debug.cw.core.ui.os.OSView#createPartControl(org.eclipse.swt.widgets.Composite)
   173 	 */
   177 	 */
   174 	@Override
   178 	@Override
   175 	public void createPartControl(Composite parent) {
   179 	public void createPartControl(Composite parent) {
   176 
   180 
   177 		final TabFolder tabFolder = new TabFolder(parent, SWT.NONE);
   181 		tabFolder = new TabFolder(parent, SWT.NONE);
   178 		tabFolder.addSelectionListener(new SelectionAdapter() {
   182 		tabFolder.addSelectionListener(new SelectionAdapter() {
   179 			public void widgetSelected(SelectionEvent e) {
   183 			public void widgetSelected(SelectionEvent e) {
   180 				DoAction_TabSelection(e.item);
   184 				DoAction_TabSelection(e.item);
   181 			}
   185 			}
   182 		});
   186 		});
   533 					status = new Status(IStatus.ERROR, KernelawarePlugin
   537 					status = new Status(IStatus.ERROR, KernelawarePlugin
   534 							.getUniqueIdentifier(), 0, e.getMessage(), null);
   538 							.getUniqueIdentifier(), 0, e.getMessage(), null);
   535 				}
   539 				}
   536 
   540 
   537 				listener.dataUpdated(session, status);
   541 				listener.dataUpdated(session, status);
       
   542 				refreshCount++;
   538 
   543 
   539 				monitor.done();
   544 				monitor.done();
   540 
   545 
   541 				return status;
   546 				return status;
   542 			}
   547 			}
   732 		MessageDialog
   737 		MessageDialog
   733 				.openInformation(m_processTableViewer.getControl().getShell(),
   738 				.openInformation(m_processTableViewer.getControl().getShell(),
   734 						Messages.getString("SymbianOSView.MessageTitle"), Messages.getString("SymbianOSView.MessagePrefix") + message); //$NON-NLS-1$ //$NON-NLS-2$
   739 						Messages.getString("SymbianOSView.MessageTitle"), Messages.getString("SymbianOSView.MessagePrefix") + message); //$NON-NLS-1$ //$NON-NLS-2$
   735 	}
   740 	}
   736 
   741 
   737 	private void DoAction_TabSelection(Widget item) {
   742 	public void DoAction_TabSelection(Widget item) {
   738 		if (item == null)
   743 		if (item == null)
   739 			return;
   744 			return;
   740 		
   745 		
   741 		if (item.equals(m_overviewTabItem)) {
   746 		if (item.equals(m_overviewTabItem)) {
   742 			m_currentViewer = m_overviewTreeViewer;
   747 			m_currentViewer = m_overviewTreeViewer;
   798 	/**
   803 	/**
   799 	 * Force refresh of all data in the view by re-reading from the target
   804 	 * Force refresh of all data in the view by re-reading from the target
   800 	 * device.
   805 	 * device.
   801 	 * 
   806 	 * 
   802 	 */
   807 	 */
   803 	private void DoAction_Refresh() {
   808 	public void DoAction_Refresh() {
   804 		if (m_currentSession == null)
   809 		if (m_currentSession == null)
   805 			return;
   810 			return;
   806 
   811 
   807 		disableTimedRefresh();
   812 		disableTimedRefresh();
   808 
   813 
   809 		m_currentSession.getOSDataManager().setDataDirty();
   814 		m_currentSession.getOSDataManager().setDataDirty();
   810 
   815 
   811 		computeInput(m_currentSession, this, true);
   816 		computeInput(m_currentSession, this, true);
   812 	}
   817 	}
   813 
   818 
   814 	private void DoAction_ToggleAutoRefresh() {
   819 	public void DoAction_ToggleAutoRefresh() {
   815 		m_autoRefresh = !m_autoRefresh;
   820 		setAutoRefresh(!m_autoRefresh);
   816 	}
   821 	}
   817 
   822 
   818 	private void DoAction_CollapseAll() {
   823 	public void setAutoRefresh(boolean enabled) {
       
   824 		m_autoRefresh = enabled;
       
   825 	}
       
   826 	
       
   827 	public void DoAction_CollapseAll() {
   819 		if (m_overviewTreeViewer != null)
   828 		if (m_overviewTreeViewer != null)
   820 			m_overviewTreeViewer.collapseAll();
   829 			m_overviewTreeViewer.collapseAll();
   821 	}
   830 	}
   822 
   831 
   823 	private void DoAction_Debug() {
   832 	public void DoAction_Debug() {
   824 		/*
   833 		/*
   825 		 * Attach debugger to a process or thread.
   834 		 * Attach debugger to a process or thread.
   826 		 */
   835 		 */
   827 		if (m_currentViewer == null)
   836 		if (m_currentViewer == null)
   828 			return;
   837 			return;
  1254 								});
  1263 								});
  1255 					}
  1264 					}
  1256 				}
  1265 				}
  1257 		}
  1266 		}
  1258 	}
  1267 	}
       
  1268 
       
  1269 	@Override
       
  1270 	public Object getAdapter(Class adapter) {
       
  1271 		if (adapter.isInstance(this))
       
  1272 			return this;
       
  1273 		if (adapter.isInstance(tabFolder))
       
  1274 			return tabFolder;
       
  1275 		if (adapter.isInstance(m_currentViewer))
       
  1276 			return m_currentViewer;
       
  1277 		
       
  1278 		return super.getAdapter(adapter);
       
  1279 	}
       
  1280 
       
  1281 	public int getRefreshCount() {
       
  1282 		return refreshCount;
       
  1283 	}
  1259 }
  1284 }