cdt/cdt_6_0_x/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/views/executables/ExecutablesView.java
author wpaul
Fri, 07 Aug 2009 13:47:27 -0500
changeset 60 3982fab6369e
parent 52 42077b7eab6e
permissions -rw-r--r--
fixed executables view merge problems - bug #'s 9562, 9568, 9571.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     1
/*******************************************************************************
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     2
 * Copyright (c) 2008 Nokia and others.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     3
 * All rights reserved. This program and the accompanying materials
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     4
 * are made available under the terms of the Eclipse Public License v1.0
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     5
 * which accompanies this distribution, and is available at
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     6
 * http://www.eclipse.org/legal/epl-v10.html
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     7
 *
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     8
 * Contributors:
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
     9
 * Nokia - Initial API and implementation
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    10
 *******************************************************************************/
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    11
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    12
package org.eclipse.cdt.debug.internal.ui.views.executables;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    13
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    14
import java.net.URL;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    15
import java.util.ArrayList;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    16
import java.util.Arrays;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    17
import java.util.List;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    18
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    19
import org.eclipse.cdt.debug.core.executables.Executable;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    20
import org.eclipse.cdt.debug.core.executables.ExecutablesManager;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    21
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    22
import org.eclipse.core.runtime.FileLocator;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    23
import org.eclipse.core.runtime.IProgressMonitor;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    24
import org.eclipse.core.runtime.IStatus;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    25
import org.eclipse.core.runtime.Path;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    26
import org.eclipse.core.runtime.Platform;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    27
import org.eclipse.core.runtime.Preferences;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    28
import org.eclipse.core.runtime.Status;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    29
import org.eclipse.core.runtime.jobs.Job;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    30
import org.eclipse.jface.action.Action;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    31
import org.eclipse.jface.action.IToolBarManager;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    32
import org.eclipse.jface.dialogs.MessageDialog;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    33
import org.eclipse.jface.resource.ImageDescriptor;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    34
import org.eclipse.jface.viewers.ISelection;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    35
import org.eclipse.jface.viewers.ISelectionChangedListener;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    36
import org.eclipse.jface.viewers.IStructuredContentProvider;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    37
import org.eclipse.jface.viewers.IStructuredSelection;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    38
import org.eclipse.jface.viewers.LabelProvider;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    39
import org.eclipse.jface.viewers.SelectionChangedEvent;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    40
import org.eclipse.jface.viewers.Viewer;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    41
import org.eclipse.jface.window.Window;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    42
import org.eclipse.swt.SWT;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    43
import org.eclipse.swt.custom.SashForm;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    44
import org.eclipse.swt.layout.FillLayout;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    45
import org.eclipse.swt.widgets.Composite;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    46
import org.eclipse.swt.widgets.FileDialog;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    47
import org.eclipse.swt.widgets.TreeColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    48
import org.eclipse.ui.IActionBars;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    49
import org.eclipse.ui.IMemento;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    50
import org.eclipse.ui.IViewSite;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    51
import org.eclipse.ui.PartInitException;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    52
import org.eclipse.ui.PlatformUI;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    53
import org.eclipse.ui.XMLMemento;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    54
import org.eclipse.ui.dialogs.ListSelectionDialog;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    55
import org.eclipse.ui.part.ViewPart;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    56
import org.eclipse.ui.progress.UIJob;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    57
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    58
/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    59
 * ExecutablesView displays a list of executable files either in the workspace
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    60
 * or created by projects in the workspace. The list of executables comes from
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    61
 * the ExecutablesManager. This view has two subviews: one that shows the list
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    62
 * of executables and another that shows the list of source files in the
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    63
 * selected executable.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    64
 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    65
 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    66
public class ExecutablesView extends ViewPart {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    67
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    68
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    69
	 * Settings for the view including the sorted column for the sub views and
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    70
	 * the list of visible columns.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    71
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    72
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    73
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    74
	 * Constants for the columns.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    75
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    76
	public final static int NAME = 0x0;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    77
	public final static int PROJECT = 0x1;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    78
	public final static int LOCATION = 0x2;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    79
	public final static int SIZE = 0x3;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    80
	public final static int MODIFIED = 0x4;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    81
	public final static int TYPE = 0x5;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    82
	public final static int ORG_LOCATION = 0x6;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    83
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    84
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    85
	 * Constants for the column sort order.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    86
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    87
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    88
	public static int ASCENDING = 1;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    89
	public static int DESCENDING = -1;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    90
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    91
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    92
	 * Display constants and icons.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    93
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    94
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    95
	public final static String ICONS_PATH = "icons/"; //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    96
	public static final String EXECUTABLES_VIEW_CONTEXT = "org.eclipse.cdt.debug.ui.executables_View_context"; //$NON-NLS-1$;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    97
	private static final String PATH_LCL = ICONS_PATH + "elcl16/"; //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    98
	private static final String PATH_LCL_DISABLED = ICONS_PATH + "dlcl16/"; //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
    99
	public static final ImageDescriptor DESC_REFRESH = create(PATH_LCL, "refresh.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   100
	public static final ImageDescriptor DESC_REFRESH_DISABLED = create(PATH_LCL_DISABLED, "refresh.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   101
	public static final ImageDescriptor DESC_IMPORT = create(PATH_LCL, "import.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   102
	public static final ImageDescriptor DESC_IMPORT_DISABLED = create(PATH_LCL_DISABLED, "import.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   103
	public static final ImageDescriptor DESC_COLUMNS = create(PATH_LCL, "columns.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   104
	public static final ImageDescriptor DESC_COLUMNS_DISABLED = create(PATH_LCL_DISABLED, "columns.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   105
	public static final ImageDescriptor DESC_REMOVE = create(PATH_LCL, "rem_co.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   106
	public static final ImageDescriptor DESC_REMOVE_DISABLED = create(PATH_LCL_DISABLED, "rem_co.gif"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   107
	public static final int COLUMN_WIDTH_PADDING = 24;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   108
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   109
	private static final String SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   110
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   111
	private static ImageDescriptor create(String prefix, String name) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   112
		return ImageDescriptor.createFromURL(makeIconURL(prefix, name));
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   113
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   114
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   115
	private static URL makeIconURL(String prefix, String name) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   116
		String path = "$nl$/" + prefix + name; //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   117
		return FileLocator.find(CDebugUIPlugin.getDefault().getBundle(), new Path(path), null);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   118
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   119
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   120
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   121
	 * Complete list of column names for both sub views. These are not display
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   122
	 * names and should not be localized. Display names are set when the columns
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   123
	 * are created in the sub views.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   124
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   125
	private String[] columnNames = { Messages.ExecutablesView_ExeName, Messages.ExecutablesView_ExeProject, Messages.ExecutablesView_ExeLocation, Messages.ExecutablesView_ExeSize, Messages.ExecutablesView_ExeData,
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   126
			Messages.ExecutablesView_ExeType, Messages.ExecutablesView_SrcName, Messages.ExecutablesView_SrcLocation, Messages.ExecutablesView_SrcOrgLocation, Messages.ExecutablesView_SrcSize, Messages.ExecutablesView_SrcDate,
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   127
			Messages.ExecutablesView_SrcType };
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   128
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   129
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   130
	 * Not all the columns are visible by default. Here are the ones that are.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   131
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   132
	private TreeColumn[] allColumns = new TreeColumn[columnNames.length];
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   133
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   134
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   135
	 * Configures the list of columns show in the view.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   136
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   137
	public class ConfigureColumnsAction extends Action {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   138
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   139
		public static final String CONFIGURE_COLUMNS_DIALOG = "org.eclipse.cdt.debug.ui.configure_columns_dialog_context"; //$NON-NLS-1$;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   140
		public static final String CONFIGURE_COLUMNS_ACTION = "org.eclipse.cdt.debug.ui.configure_columns_action_context"; //$NON-NLS-1$;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   141
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   142
		class ColumnContentProvider implements IStructuredContentProvider {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   143
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   144
			/*
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   145
			 * (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   146
			 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   147
			 * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   148
			 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   149
			public Object[] getElements(Object inputElement) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   150
				return columnNames;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   151
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   152
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   153
			/*
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   154
			 * (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   155
			 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   156
			 * @see org.eclipse.jface.viewers.IContentProvider#dispose()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   157
			 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   158
			public void dispose() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   159
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   160
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   161
			/*
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   162
			 * (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   163
			 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   164
			 * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   165
			 *      java.lang.Object, java.lang.Object)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   166
			 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   167
			public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   168
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   169
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   170
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   171
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   172
		class ColumnLabelProvider extends LabelProvider {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   173
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   174
			public String getText(Object element) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   175
				return (String) element;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   176
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   177
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   178
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   179
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   180
		public ConfigureColumnsAction() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   181
			setText(Messages.ExecutablesView_ConfigureColumns);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   182
			setId(CDebugUIPlugin.getUniqueIdentifier() + ".ConfigureColumnsAction"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   183
			PlatformUI.getWorkbench().getHelpSystem().setHelp(this, CONFIGURE_COLUMNS_ACTION);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   184
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   185
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   186
		/*
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   187
		 * (non-Javadoc)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   188
		 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   189
		 * @see org.eclipse.jface.action.Action#run()
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   190
		 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   191
		public void run() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   192
			ListSelectionDialog dialog = new ListSelectionDialog(ExecutablesView.this.getExecutablesViewer().getTree().getShell(), this,
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   193
					new ColumnContentProvider(), new ColumnLabelProvider(), Messages.ExecutablesView_SelectColumns);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   194
			PlatformUI.getWorkbench().getHelpSystem().setHelp(this, CONFIGURE_COLUMNS_DIALOG);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   195
			String[] visibleColumns = getVisibleColumns();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   196
			List<String> initialSelection = new ArrayList<String>(visibleColumns.length);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   197
			for (int i = 0; i < visibleColumns.length; i++) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   198
				initialSelection.add(visibleColumns[i]);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   199
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   200
			dialog.setTitle(Messages.ExecutablesView_ConfigureColumns);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   201
			dialog.setInitialElementSelections(initialSelection);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   202
			if (dialog.open() == Window.OK) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   203
				Object[] result = dialog.getResult();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   204
				String[] ids = new String[result.length];
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   205
				System.arraycopy(result, 0, ids, 0, result.length);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   206
				setVisibleColumns(ids);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   207
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   208
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   209
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   210
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   211
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   212
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   213
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   214
	 * Sub viewers and trees
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   215
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   216
	private SourceFilesViewer sourceFilesViewer;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   217
	private ExecutablesViewer executablesViewer;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   218
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   219
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   220
	 * Associated Actions
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   221
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   222
	Action refreshAction;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   223
	Action importAction;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   224
	Action removeAction;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   225
	private Action configureColumnsAction;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   226
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   227
	private IMemento memento;
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   228
	
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   229
	private IStructuredSelection oldSelection;
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   230
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   231
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   232
	 * Create contents of the Executables View
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   233
	 * 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   234
	 * @param parent
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   235
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   236
	@Override
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   237
	public void createPartControl(Composite parent) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   238
		Composite container = new Composite(parent, SWT.NONE);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   239
		container.setLayout(new FillLayout());
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   240
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   241
		final SashForm sashForm = new SashForm(container, SWT.NONE);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   242
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   243
		// Create the two sub viewers.
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   244
		executablesViewer = new ExecutablesViewer(this, sashForm, SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI);
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   245
		ExecutablesManager.getExecutablesManager().addExecutablesChangeListener(executablesViewer);
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   246
		sourceFilesViewer = new SourceFilesViewer(this, sashForm, SWT.BORDER | SWT.MULTI);
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   247
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   248
		sashForm.setWeights(new int[] { 1, 1 });
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   249
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   250
		// Keep a combined list of all the columns so
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   251
		// we can easily operate on them all.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   252
		allColumns[0] = executablesViewer.nameColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   253
		allColumns[1] = executablesViewer.projectColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   254
		allColumns[2] = executablesViewer.locationColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   255
		allColumns[3] = executablesViewer.sizeColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   256
		allColumns[4] = executablesViewer.modifiedColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   257
		allColumns[5] = executablesViewer.typeColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   258
		allColumns[6] = sourceFilesViewer.nameColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   259
		allColumns[7] = sourceFilesViewer.locationColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   260
		allColumns[8] = sourceFilesViewer.originalLocationColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   261
		allColumns[9] = sourceFilesViewer.sizeColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   262
		allColumns[10] = sourceFilesViewer.modifiedColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   263
		allColumns[11] = sourceFilesViewer.typeColumn;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   264
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   265
		readSettings();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   266
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   267
		createActions();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   268
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   269
		// When the selection changes in the executables list
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   270
		// update the source files viewer
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   271
		executablesViewer.addSelectionChangedListener(new ISelectionChangedListener() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   272
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   273
			public void selectionChanged(SelectionChangedEvent event) {
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   274
				ISelection newSelection = event.getSelection();
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   275
				if (newSelection instanceof IStructuredSelection) {
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   276
					
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   277
					if (oldSelection == null || !oldSelection.equals(newSelection))
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   278
					{
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   279
						// update the remove action
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   280
						removeAction.setEnabled(!newSelection.isEmpty());
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   281
						
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   282
						final Object firstElement = ((IStructuredSelection) newSelection).getFirstElement();
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   283
						
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   284
						Job setectExeJob = new Job(Messages.ExecutablesView_Select_Executable) {
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   285
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   286
							@Override
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   287
							protected IStatus run(IProgressMonitor monitor) {
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   288
								if (firstElement instanceof Executable) {
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   289
									Executable executable = (Executable)firstElement;
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   290
									this.setName(Messages.ExecutablesView_Finding_Sources_Job_Name + executable.getName());
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   291
									executable.getSourceFiles(monitor);
52
42077b7eab6e Second merge to proper cdt_6_0 branch for CDT bugs 181020, 279844, & Carbide bugs 6152 & 9031.
timkelly
parents: 51
diff changeset
   292
								}
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   293
								// selection could be empty, so do this no matter what to update the source
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   294
								// files viewer
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   295
								UIJob selectExeUIJob = new UIJob(Messages.ExecutablesView_Select_Executable){
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   296
									@Override
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   297
									public IStatus runInUIThread(IProgressMonitor monitor) {
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   298
										sourceFilesViewer.setInput(firstElement);
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   299
										sourceFilesViewer.packColumns();
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   300
										return Status.OK_STATUS;
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   301
									}};
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   302
								selectExeUIJob.schedule();								
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   303
								return Status.OK_STATUS;
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   304
							}};
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   305
						setectExeJob.schedule();
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   306
						oldSelection = (IStructuredSelection) newSelection;
52
42077b7eab6e Second merge to proper cdt_6_0 branch for CDT bugs 181020, 279844, & Carbide bugs 6152 & 9031.
timkelly
parents: 51
diff changeset
   307
					}
60
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   308
					
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   309
				}
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   310
			}
3982fab6369e fixed executables view merge problems - bug #'s 9562, 9568, 9571.
wpaul
parents: 52
diff changeset
   311
		});
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   312
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   313
		executablesViewer.packColumns();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   314
		sourceFilesViewer.packColumns();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   315
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   316
		PlatformUI.getWorkbench().getHelpSystem().setHelp(container, EXECUTABLES_VIEW_CONTEXT);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   317
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   318
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   319
	private void setVisibleColumns(String[] ids) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   320
		List<String> visibleNames = Arrays.asList(ids);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   321
		for (int i = 0; i < columnNames.length; i++) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   322
			makeColumnVisible(visibleNames.contains(columnNames[i]), allColumns[i]);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   323
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   324
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   325
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   326
	private void makeColumnVisible(boolean visible, TreeColumn column) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   327
		boolean isVisible = column.getWidth() > 0;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   328
		if (isVisible != visible) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   329
			if (visible) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   330
				column.setResizable(true);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   331
				column.pack();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   332
				column.setWidth(column.getWidth() + COLUMN_WIDTH_PADDING);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   333
			} else {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   334
				column.setWidth(0);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   335
				column.setResizable(false);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   336
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   337
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   338
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   339
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   340
	private String[] getVisibleColumns() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   341
		ArrayList<String> visibleNames = new ArrayList<String>();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   342
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   343
		for (int i = 0; i < columnNames.length; i++) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   344
			if (allColumns[i].getWidth() > 0)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   345
				visibleNames.add(columnNames[i]);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   346
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   347
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   348
		return visibleNames.toArray(new String[visibleNames.size()]);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   349
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   350
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   351
	/**
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   352
	 * Create the actions to refresh, import, and configure the columns
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   353
	 */
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   354
	private void createActions() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   355
		IActionBars bars = getViewSite().getActionBars();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   356
		IToolBarManager toolBarManager = bars.getToolBarManager();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   357
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   358
		refreshAction = createRefreshAction();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   359
		toolBarManager.add(refreshAction);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   360
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   361
		importAction = createImportAction();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   362
		toolBarManager.add(importAction);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   363
		
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   364
		removeAction = createRemoveAction();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   365
		toolBarManager.add(removeAction);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   366
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   367
		configureColumnsAction = createConfigureColumnsAction();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   368
		toolBarManager.add(configureColumnsAction);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   369
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   370
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   371
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   372
	private Action createRemoveAction() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   373
		Action action = new Action("Remove") {
52
42077b7eab6e Second merge to proper cdt_6_0 branch for CDT bugs 181020, 279844, & Carbide bugs 6152 & 9031.
timkelly
parents: 51
diff changeset
   374
			
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   375
			public void run() {				
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   376
				ISelection selection = getExecutablesViewer().getSelection();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   377
				if (selection instanceof IStructuredSelection)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   378
				{
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   379
					Object[] selectedObjects = ((IStructuredSelection)selection).toArray();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   380
					ArrayList<Executable> selectedExes = new ArrayList<Executable>();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   381
					for (Object object : selectedObjects) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   382
						if (object instanceof Executable)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   383
							selectedExes.add((Executable) object);						
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   384
					}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   385
					final Executable[] selectedExesArray = selectedExes.toArray(new Executable[selectedExes.size()]);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   386
					
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   387
					boolean confirm = MessageDialog.openConfirm(getSite().getShell(), "Confirm Remove Executables", "Are you sure you want to remove the selected executables?");
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   388
					
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   389
					if (confirm)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   390
					{
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   391
						Job removeJob = new UIJob("Remove Executables") {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   392
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   393
						public IStatus runInUIThread(IProgressMonitor monitor) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   394
								IStatus result = ExecutablesManager.getExecutablesManager().removeExecutables(selectedExesArray, monitor);					
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   395
								if (result.getSeverity() != IStatus.OK)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   396
								{
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   397
									StringBuffer message = new StringBuffer(result.getMessage());
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   398
									if (result.isMultiStatus()) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   399
										IStatus[] children = result.getChildren();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   400
										for (int i = 0; i < children.length && i < 6; i++) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   401
											message.append(SEPARATOR);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   402
											message.append(children[i].getMessage()); 
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   403
										}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   404
									}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   405
									MessageDialog.openWarning(getSite().getShell(), "Remove Executables", message.toString());
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   406
								}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   407
								return result;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   408
							}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   409
						};
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   410
						removeJob.schedule();						
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   411
					}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   412
				}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   413
				
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   414
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   415
		};
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   416
		action.setToolTipText("Remove the selected executables");
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   417
		action.setImageDescriptor(ExecutablesView.DESC_REMOVE);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   418
		action.setDisabledImageDescriptor(ExecutablesView.DESC_REMOVE_DISABLED);
52
42077b7eab6e Second merge to proper cdt_6_0 branch for CDT bugs 181020, 279844, & Carbide bugs 6152 & 9031.
timkelly
parents: 51
diff changeset
   419
		action.setEnabled(false);
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   420
		return action;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   421
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   422
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   423
	private Action createConfigureColumnsAction() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   424
		ConfigureColumnsAction action = new ConfigureColumnsAction();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   425
		action.setToolTipText(Messages.ExecutablesView_Columns);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   426
		action.setImageDescriptor(ExecutablesView.DESC_COLUMNS);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   427
		action.setDisabledImageDescriptor(ExecutablesView.DESC_COLUMNS_DISABLED);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   428
		action.setEnabled(true);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   429
		return action;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   430
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   431
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   432
	protected void importExecutables(final String[] fileNames) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   433
		if (fileNames.length > 0) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   434
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   435
			Job importJob = new Job(Messages.ExecutablesView_ImportExecutables) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   436
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   437
				@Override
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   438
				public IStatus run(IProgressMonitor monitor) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   439
					ExecutablesManager.getExecutablesManager().importExecutables(fileNames, monitor);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   440
					return Status.OK_STATUS;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   441
				}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   442
			};
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   443
			importJob.schedule();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   444
		}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   445
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   446
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   447
	private Action createImportAction() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   448
		Action action = new Action(Messages.ExecutablesView_Import) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   449
			public void run() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   450
				FileDialog dialog = new FileDialog(getViewSite().getShell(), SWT.NONE);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   451
				dialog.setText(Messages.ExecutablesView_SelectExeFile);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   452
				String res = dialog.open();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   453
				if (res != null) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   454
					if (Platform.getOS().equals(Platform.OS_MACOSX) && res.endsWith(".app")) { //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   455
						// On Mac OS X the file dialog will let you select the
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   456
						// package but not the executable inside.
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   457
						Path macPath = new Path(res);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   458
						res = res + "/Contents/MacOS/" + macPath.lastSegment(); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   459
						res = res.substring(0, res.length() - 4);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   460
					}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   461
					importExecutables(new String[] { res });
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   462
				}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   463
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   464
		};
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   465
		action.setToolTipText(Messages.ExecutablesView_ImportExe);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   466
		action.setImageDescriptor(ExecutablesView.DESC_IMPORT);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   467
		action.setDisabledImageDescriptor(ExecutablesView.DESC_IMPORT_DISABLED);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   468
		action.setEnabled(true);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   469
		return action;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   470
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   471
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   472
	private Action createRefreshAction() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   473
		Action action = new Action(Messages.ExecutablesView_Refresh) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   474
			public void run() {
52
42077b7eab6e Second merge to proper cdt_6_0 branch for CDT bugs 181020, 279844, & Carbide bugs 6152 & 9031.
timkelly
parents: 51
diff changeset
   475
				ExecutablesManager.getExecutablesManager().refresh(null);
37
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   476
			}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   477
		};
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   478
		action.setToolTipText(Messages.ExecutablesView_RefreshList);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   479
		action.setImageDescriptor(ExecutablesView.DESC_REFRESH);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   480
		action.setDisabledImageDescriptor(ExecutablesView.DESC_REFRESH_DISABLED);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   481
		action.setEnabled(true);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   482
		return action;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   483
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   484
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   485
	@Override
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   486
	public void setFocus() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   487
		// Set the focus
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   488
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   489
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   490
	@Override
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   491
	public void init(IViewSite site, IMemento memento) throws PartInitException {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   492
		if (memento == null)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   493
			this.memento = XMLMemento.createWriteRoot("EXECUTABLESVIEW"); //$NON-NLS-1$
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   494
		else
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   495
			this.memento = memento;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   496
		super.init(site, memento);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   497
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   498
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   499
	private Preferences getViewPreferences() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   500
		return CDebugUIPlugin.getDefault().getPluginPreferences();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   501
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   502
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   503
	private void readSettings() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   504
		Preferences prefs = getViewPreferences();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   505
		getExecutablesViewer().restoreColumnSettings(prefs);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   506
		getSourceFilesViewer().restoreColumnSettings(prefs);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   507
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   508
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   509
	private void writeSettings() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   510
		Preferences prefs = getViewPreferences();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   511
		getExecutablesViewer().saveColumnSettings(prefs);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   512
		getSourceFilesViewer().saveColumnSettings(prefs);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   513
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   514
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   515
	@Override
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   516
	public void saveState(IMemento memento) {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   517
		if (this.memento == null || memento == null)
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   518
			return;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   519
		memento.putMemento(this.memento);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   520
		writeSettings();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   521
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   522
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   523
	public SourceFilesViewer getSourceFilesViewer() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   524
		return sourceFilesViewer;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   525
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   526
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   527
	public ExecutablesViewer getExecutablesViewer() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   528
		return executablesViewer;
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   529
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   530
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   531
	@Override
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   532
	public void dispose() {
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   533
		ExecutablesManager.getExecutablesManager().removeExecutablesChangeListener(executablesViewer);
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   534
		super.dispose();
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   535
	}
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   536
c2bce6dd59e7 add cdt_6_0_x
cawthron
parents:
diff changeset
   537
}