|
Lines 11-16
Link Here
|
| 11 |
package org.eclipse.ui.externaltools.internal.ui; |
11 |
package org.eclipse.ui.externaltools.internal.ui; |
| 12 |
|
12 |
|
| 13 |
|
13 |
|
|
|
14 |
import java.lang.reflect.InvocationTargetException; |
| 14 |
import java.text.MessageFormat; |
15 |
import java.text.MessageFormat; |
| 15 |
import java.util.ArrayList; |
16 |
import java.util.ArrayList; |
| 16 |
import java.util.HashMap; |
17 |
import java.util.HashMap; |
|
Lines 28-33
Link Here
|
| 28 |
import org.eclipse.core.resources.ResourcesPlugin; |
29 |
import org.eclipse.core.resources.ResourcesPlugin; |
| 29 |
import org.eclipse.core.runtime.CoreException; |
30 |
import org.eclipse.core.runtime.CoreException; |
| 30 |
import org.eclipse.core.runtime.IAdaptable; |
31 |
import org.eclipse.core.runtime.IAdaptable; |
|
|
32 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 31 |
import org.eclipse.core.runtime.IStatus; |
33 |
import org.eclipse.core.runtime.IStatus; |
| 32 |
import org.eclipse.core.runtime.Status; |
34 |
import org.eclipse.core.runtime.Status; |
| 33 |
import org.eclipse.debug.core.DebugPlugin; |
35 |
import org.eclipse.debug.core.DebugPlugin; |
|
Lines 41-46
Link Here
|
| 41 |
import org.eclipse.jface.dialogs.IDialogConstants; |
43 |
import org.eclipse.jface.dialogs.IDialogConstants; |
| 42 |
import org.eclipse.jface.dialogs.MessageDialog; |
44 |
import org.eclipse.jface.dialogs.MessageDialog; |
| 43 |
import org.eclipse.jface.dialogs.MessageDialogWithToggle; |
45 |
import org.eclipse.jface.dialogs.MessageDialogWithToggle; |
|
|
46 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
| 44 |
import org.eclipse.jface.preference.IPreferenceStore; |
47 |
import org.eclipse.jface.preference.IPreferenceStore; |
| 45 |
import org.eclipse.jface.viewers.CheckStateChangedEvent; |
48 |
import org.eclipse.jface.viewers.CheckStateChangedEvent; |
| 46 |
import org.eclipse.jface.viewers.CheckboxTableViewer; |
49 |
import org.eclipse.jface.viewers.CheckboxTableViewer; |
|
Lines 64-69
Link Here
|
| 64 |
import org.eclipse.swt.widgets.Listener; |
67 |
import org.eclipse.swt.widgets.Listener; |
| 65 |
import org.eclipse.swt.widgets.Table; |
68 |
import org.eclipse.swt.widgets.Table; |
| 66 |
import org.eclipse.swt.widgets.TableItem; |
69 |
import org.eclipse.swt.widgets.TableItem; |
|
|
70 |
import org.eclipse.ui.PlatformUI; |
| 67 |
import org.eclipse.ui.dialogs.ElementListSelectionDialog; |
71 |
import org.eclipse.ui.dialogs.ElementListSelectionDialog; |
| 68 |
import org.eclipse.ui.dialogs.PropertyPage; |
72 |
import org.eclipse.ui.dialogs.PropertyPage; |
| 69 |
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab; |
73 |
import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab; |
|
Lines 76-81
Link Here
|
| 76 |
import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; |
80 |
import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; |
| 77 |
import org.eclipse.ui.externaltools.internal.model.IPreferenceConstants; |
81 |
import org.eclipse.ui.externaltools.internal.model.IPreferenceConstants; |
| 78 |
import org.eclipse.ui.help.WorkbenchHelp; |
82 |
import org.eclipse.ui.help.WorkbenchHelp; |
|
|
83 |
import org.eclipse.ui.progress.IProgressService; |
| 79 |
|
84 |
|
| 80 |
/** |
85 |
/** |
| 81 |
* Property page to add external tools in between builders. |
86 |
* Property page to add external tools in between builders. |
|
Lines 826-839
Link Here
|
| 826 |
return super.performOk(); |
831 |
return super.performOk(); |
| 827 |
} |
832 |
} |
| 828 |
userHasMadeChanges= false; |
833 |
userHasMadeChanges= false; |
|
|
834 |
Table builderTable= viewer.getTable(); |
| 835 |
int numCommands = builderTable.getItemCount(); |
| 836 |
final Object[] itemData= new Object[numCommands]; |
| 837 |
for (int i = 0; i < numCommands; i++) { |
| 838 |
itemData[i]= builderTable.getItem(i).getData(); |
| 839 |
} |
| 840 |
IRunnableWithProgress runnable= new IRunnableWithProgress() { |
| 841 |
public void run(IProgressMonitor monitor) |
| 842 |
throws InvocationTargetException, InterruptedException { |
| 843 |
doPerformOk(monitor, itemData); |
| 844 |
if (monitor.isCanceled()) { |
| 845 |
throw new InterruptedException(); |
| 846 |
} |
| 847 |
} |
| 848 |
}; |
| 829 |
|
849 |
|
|
|
850 |
IProgressService service= PlatformUI.getWorkbench().getProgressService(); |
| 851 |
try { |
| 852 |
service.busyCursorWhile(runnable); |
| 853 |
} catch (InvocationTargetException e) { |
| 854 |
return false; |
| 855 |
} catch (InterruptedException e) { |
| 856 |
return false; |
| 857 |
} |
| 858 |
return super.performOk(); |
| 859 |
} |
| 860 |
|
| 861 |
private void doPerformOk(IProgressMonitor monitor, Object[] itemData) { |
| 862 |
if (monitor.isCanceled()) { |
| 863 |
return; |
| 864 |
} |
| 830 |
IProject project = getInputProject(); |
865 |
IProject project = getInputProject(); |
| 831 |
//get all the build commands |
866 |
//get all the build commands |
| 832 |
Table builderTable= viewer.getTable(); |
867 |
int numCommands = itemData.length; |
| 833 |
int numCommands = builderTable.getItemCount(); |
|
|
| 834 |
ICommand[] commands = new ICommand[numCommands]; |
868 |
ICommand[] commands = new ICommand[numCommands]; |
| 835 |
for (int i = 0; i < numCommands; i++) { |
869 |
for (int i = 0; i < numCommands; i++) { |
| 836 |
Object data = builderTable.getItem(i).getData(); |
870 |
Object data = itemData[i]; |
| 837 |
if (data instanceof ICommand) { |
871 |
if (data instanceof ICommand) { |
| 838 |
ICommand command= (ICommand)data; |
872 |
ICommand command= (ICommand)data; |
| 839 |
Map args= command.getArguments(); |
873 |
Map args= command.getArguments(); |
|
Lines 893-900
Link Here
|
| 893 |
if (configsToBeDeleted != null) { |
927 |
if (configsToBeDeleted != null) { |
| 894 |
deleteConfigurations(); |
928 |
deleteConfigurations(); |
| 895 |
} |
929 |
} |
| 896 |
|
|
|
| 897 |
return super.performOk(); |
| 898 |
} |
930 |
} |
| 899 |
|
931 |
|
| 900 |
/** |
932 |
/** |
|
Lines 1076-1079
Link Here
|
| 1076 |
} |
1108 |
} |
| 1077 |
return super.performCancel(); |
1109 |
return super.performCancel(); |
| 1078 |
} |
1110 |
} |
| 1079 |
} |
1111 |
} |