cdt/cdt_6_0_x/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/ExecutablesViewer.java
changeset 60 3982fab6369e
parent 52 42077b7eab6e
equal deleted inserted replaced
59:a612e067382b 60:3982fab6369e
     9  * Nokia - Initial API and implementation
     9  * Nokia - Initial API and implementation
    10  *******************************************************************************/
    10  *******************************************************************************/
    11 package org.eclipse.cdt.debug.internal.ui.views.executables;
    11 package org.eclipse.cdt.debug.internal.ui.views.executables;
    12 
    12 
    13 import java.util.List;
    13 import java.util.List;
       
    14 
    14 import org.eclipse.cdt.debug.core.executables.Executable;
    15 import org.eclipse.cdt.debug.core.executables.Executable;
    15 import org.eclipse.cdt.debug.core.executables.ExecutablesManager;
    16 import org.eclipse.cdt.debug.core.executables.ExecutablesManager;
    16 import org.eclipse.cdt.debug.core.executables.IExecutablesChangeListener;
    17 import org.eclipse.cdt.debug.core.executables.IExecutablesChangeListener;
    17 import org.eclipse.core.runtime.IProgressMonitor;
    18 import org.eclipse.core.runtime.IProgressMonitor;
    18 import org.eclipse.core.runtime.IStatus;
    19 import org.eclipse.core.runtime.IStatus;
   164 			};
   165 			};
   165 		}
   166 		}
   166 		return new ExecutablesViewerComparator(sortType, column_sort_order[sortType]);
   167 		return new ExecutablesViewerComparator(sortType, column_sort_order[sortType]);
   167 	}
   168 	}
   168 
   169 
   169 	
       
   170 	@Override
   170 	@Override
   171 	protected String getColumnOrderKey() {
   171 	protected String getColumnOrderKey() {
   172 		return P_COLUMN_ORDER_KEY_EXE;
   172 		return P_COLUMN_ORDER_KEY_EXE;
   173 	}
   173 	}
   174 
   174 
   190 	@Override
   190 	@Override
   191 	protected String getDefaultVisibleColumnsValue() {
   191 	protected String getDefaultVisibleColumnsValue() {
   192 		// default visible columns
   192 		// default visible columns
   193 		return "1,1,1,0,0,0"; //$NON-NLS-1$
   193 		return "1,1,1,0,0,0"; //$NON-NLS-1$
   194 	}
   194 	}
   195 	
   195 
   196 	public void executablesChanged(final List<Executable> executables) {
   196 	public void executablesChanged(final List<Executable> executables) {
   197 		// some executables have been updated. if one of them is currently
   197 		// some executables have been updated.  if one of them is currently
   198 		// selected, we need to update the source file list
   198 		// selected, we need to update the source file list
   199 		UIJob refreshJob = new UIJob(
   199 		UIJob refreshJob = new UIJob(Messages.ExecutablesViewer_RefreshExecutablesView) {
   200 				Messages.ExecutablesViewer_RefreshExecutablesView) {
       
   201 
   200 
   202 			@Override
   201 			@Override
   203 			public IStatus runInUIThread(IProgressMonitor monitor) {
   202 			public IStatus runInUIThread(IProgressMonitor monitor) {
   204 				// if the user has selected an executable, they expect its
   203 				// if the user has selected an executable, they expect its
   205 				// list of source files to be refreshed automatically
   204 				// list of source files to be refreshed automatically
   206 				if (getSelection() != null
   205 				if (getSelection() != null &&
   207 						&& getSelection() instanceof IStructuredSelection) {
   206 					getSelection() instanceof IStructuredSelection) {
   208 					IStructuredSelection selection = (IStructuredSelection) getSelection();
   207 					IStructuredSelection selection = (IStructuredSelection)getSelection();
   209 
   208 					
   210 					Object firstElement = selection.getFirstElement();
   209 					Object firstElement = selection.getFirstElement();
   211 					if (firstElement instanceof Executable) {
   210 					if (firstElement instanceof Executable) {
   212 						Executable executable = (Executable) firstElement;
   211 						Executable executable = (Executable) firstElement;
   213 						if (executables.contains(executable)) {
   212 						if (executables.contains(executable)) {
   214 							executable.setRefreshSourceFiles(true);
   213 							executable.setRefreshSourceFiles(true);
   222 		refreshJob.schedule();
   221 		refreshJob.schedule();
   223 	}
   222 	}
   224 
   223 
   225 	public void executablesListChanged() {
   224 	public void executablesListChanged() {
   226 		// Executables list has changed so refresh the view.
   225 		// Executables list has changed so refresh the view.
   227 		UIJob refreshJob = new UIJob(
   226 		UIJob refreshJob = new UIJob(Messages.ExecutablesViewer_RefreshExecutablesView) {
   228 				Messages.ExecutablesViewer_RefreshExecutablesView) {
       
   229 
   227 
   230 			@Override
   228 			@Override
   231 			public IStatus runInUIThread(IProgressMonitor monitor) {
   229 			public IStatus runInUIThread(IProgressMonitor monitor) {
   232 				refresh(null);
   230 				refresh(null);
   233 				packColumns();
   231 				packColumns();