Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2003-08-20 22:19:28 -0400
committerDavid Inglis2003-08-20 22:19:28 -0400
commita31b9f5d4f312f1dcfa0e6536150393193b60181 (patch)
tree5bb9e2d10d84d13beb3ba4a6dd201868d2299bff
parent46969ea9ba604d2dd62264570ee13bf71940d31f (diff)
downloadorg.eclipse.cdt-a31b9f5d4f312f1dcfa0e6536150393193b60181.tar.gz
org.eclipse.cdt-a31b9f5d4f312f1dcfa0e6536150393193b60181.tar.xz
org.eclipse.cdt-a31b9f5d4f312f1dcfa0e6536150393193b60181.zip
work in progress - create/edit target dialog
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java1
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java2
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java3
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java116
-rw-r--r--build/org.eclipse.cdt.make.ui/plugin.xml4
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractMakeBuilderAction.java44
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetDialog.java140
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateBuildAction.java25
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeContentProvider.java8
9 files changed, 239 insertions, 104 deletions
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java
index ff59cd2303e..2c0636e5b0f 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/IMakeTargetManager.java
@@ -23,6 +23,7 @@ public interface IMakeTargetManager {
IProject[] getTargetBuilderProjects() throws CoreException;
String getBuilderID(String targetBuilderID);
+ String[] getTargetBuilders(IProject project);
void addListener(IMakeTargetListener listener);
void removeListener(IMakeTargetListener listener);
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java
index c5ae3db4dc3..70580e9f65f 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakeCorePlugin.java
@@ -139,7 +139,7 @@ public class MakeCorePlugin extends Plugin {
return BuildInfoFactory.create(args, builderID);
}
- public IMakeTargetManager getTargetProvider() {
+ public IMakeTargetManager getTargetManager() {
if ( fTargetManager == null) {
fTargetManager = new MakeTargetManager();
fTargetManager.startup();
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java
index cca69afa675..3b5f9950e4c 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTarget.java
@@ -86,7 +86,7 @@ public class MakeTarget implements IMakeTarget {
public void build(IProgressMonitor monitor) throws CoreException {
IProject project = container.getProject();
- String builderID = MakeCorePlugin.getDefault().getTargetProvider().getBuilderID(targetBuilderID);
+ String builderID = MakeCorePlugin.getDefault().getTargetManager().getBuilderID(targetBuilderID);
HashMap infoMap = new HashMap();
IMakeBuilderInfo info = MakeCorePlugin.createBuildInfo(infoMap, builderID);
info.setBuildArguments(buildArguments);
@@ -95,6 +95,7 @@ public class MakeTarget implements IMakeTarget {
info.setStopOnError(isStopOnError);
info.setFullBuildEnable(true);
info.setFullBuildTarget(buildArguments);
+ info.setBuildLocation(container.getLocation());
project.build(IncrementalProjectBuilder.FULL_BUILD, builderID, infoMap, monitor);
}
}
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java
index 6c513b250de..e29b04accc5 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakeTargetManager.java
@@ -16,7 +16,10 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
import java.util.Vector;
+import java.util.Map.Entry;
import org.eclipse.cdt.make.core.IMakeTarget;
import org.eclipse.cdt.make.core.IMakeTargetListener;
@@ -57,7 +60,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
if (container instanceof IWorkspaceRoot) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.add_to_workspace_root"), null)); //$NON-NLS-1$
}
- ProjectTargets projectTargets = (ProjectTargets) projectMap.get(container.getProject());
+ ProjectTargets projectTargets = (ProjectTargets)projectMap.get(container.getProject());
if (projectTargets == null) {
projectTargets = readTargets(container.getProject());
}
@@ -70,7 +73,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
public void removeTarget(IMakeTarget target) throws CoreException {
IProject project = target.getContainer().getProject();
- ProjectTargets projectTargets = (ProjectTargets) projectMap.get(project);
+ ProjectTargets projectTargets = (ProjectTargets)projectMap.get(project);
if (projectTargets == null) {
projectTargets = readTargets(project);
}
@@ -81,20 +84,20 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
public void renameTarget(IMakeTarget target, String name) throws CoreException {
IProject project = target.getContainer().getProject();
- ProjectTargets projectTargets = (ProjectTargets) projectMap.get(project);
+ ProjectTargets projectTargets = (ProjectTargets)projectMap.get(project);
if (projectTargets == null) {
projectTargets = readTargets(project);
}
- if (!projectTargets.contains((MakeTarget) target)) {
+ if (!projectTargets.contains((MakeTarget)target)) {
throw new CoreException(new Status(IStatus.ERROR, MakeCorePlugin.getUniqueIdentifier(), -1, MakeCorePlugin.getResourceString("MakeTargetManager.target_exists"), null)); //$NON-NLS-1$
}
- ((MakeTarget) target).setName(name);
+ ((MakeTarget)target).setName(name);
writeTargets(projectTargets);
notifyListeners(new MakeTargetEvent(this, MakeTargetEvent.TARGET_CHANGED, target));
}
public IMakeTarget[] getTargets(IContainer container) throws CoreException {
- ProjectTargets projectTargets = (ProjectTargets) projectMap.get(container.getProject());
+ ProjectTargets projectTargets = (ProjectTargets)projectMap.get(container.getProject());
if (projectTargets == null) {
projectTargets = readTargets(container.getProject());
}
@@ -102,16 +105,41 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
}
public IProject[] getTargetBuilderProjects() throws CoreException {
- return (IProject[]) fProjects.toArray(new IProject[fProjects.size()]);
+ return (IProject[])fProjects.toArray(new IProject[fProjects.size()]);
}
- protected boolean hasTargetBuilder(IProject project) throws CoreException {
- IProjectDescription description = project.getDescription();
- ICommand builder[] = description.getBuildSpec();
- for (int j = 0; j < builder.length; j++) {
- if (builderMap.containsValue(builder[j].getBuilderName())) {
- return true;
+ public String[] getTargetBuilders(IProject project) {
+ if (fProjects.contains(project)) {
+ try {
+ Vector ids = new Vector();
+ IProjectDescription description = project.getDescription();
+ ICommand builder[] = description.getBuildSpec();
+ for (int i = 0; i < builder.length; i++) {
+ Iterator entries = builderMap.entrySet().iterator();
+ while (entries.hasNext()) {
+ Map.Entry entry = (Entry)entries.next();
+ if (entry.getValue().equals(builder[i].getBuilderName())) {
+ ids.add(entry.getKey());
+ }
+ }
+ }
+ return (String[])ids.toArray(new String[ids.size()]);
+ } catch (CoreException e) {
+ }
+ }
+ return new String[0];
+ }
+
+ protected boolean hasTargetBuilder(IProject project) {
+ try {
+ IProjectDescription description = project.getDescription();
+ ICommand builder[] = description.getBuildSpec();
+ for (int j = 0; j < builder.length; j++) {
+ if (builderMap.containsValue(builder[j].getBuilderName())) {
+ return true;
+ }
}
+ } catch (CoreException e) {
}
return false;
}
@@ -120,12 +148,9 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
initializeBuilders();
IProject project[] = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (int i = 0; i < project.length; i++) {
- try {
- if (hasTargetBuilder(project[i])) {
- fProjects.add(project[i]);
- break;
- }
- } catch (CoreException e) {
+ if (hasTargetBuilder(project[i])) {
+ fProjects.add(project[i]);
+ break;
}
}
ResourcesPlugin.getWorkspace().addResourceChangeListener(this);
@@ -157,16 +182,13 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
}
IResource resource = delta.getResource();
if (resource.getType() == IResource.PROJECT) {
- IProject project = (IProject) resource;
+ IProject project = (IProject)resource;
int flags = delta.getFlags();
int deltaKind = delta.getKind();
if (deltaKind == IResourceDelta.ADDED) {
- try {
- if (hasTargetBuilder(project)) {
- fProjects.add(project);
- notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project));
- }
- } catch (CoreException e) {
+ if (hasTargetBuilder(project)) {
+ fProjects.add(project);
+ notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project));
}
} else if (deltaKind == IResourceDelta.REMOVED) {
if (fProjects.contains(project)) {
@@ -174,30 +196,23 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project));
}
} else if (deltaKind == IResourceDelta.CHANGED) {
- try {
- if (0 != (flags & IResourceDelta.DESCRIPTION)) {
- if (fProjects.contains(project) && !hasTargetBuilder(project)) {
- fProjects.remove(project);
- notifyListeners(
- new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project));
- } else if (!fProjects.contains(project) && hasTargetBuilder(project)) {
- fProjects.add(project);
- notifyListeners(
- new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project));
- }
+ if (0 != (flags & IResourceDelta.DESCRIPTION)) {
+ if (fProjects.contains(project) && !hasTargetBuilder(project)) {
+ fProjects.remove(project);
+ notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project));
+ } else if (!fProjects.contains(project) && hasTargetBuilder(project)) {
+ fProjects.add(project);
+ notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project));
}
- if (0 != (flags & IResourceDelta.OPEN)) {
- if (!project.isOpen() && fProjects.contains(project)) {
- fProjects.remove(project);
- notifyListeners(
- new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project));
- } else if (project.isOpen() && hasTargetBuilder(project) && !fProjects.contains(project)) {
- fProjects.add(project);
- notifyListeners(
- new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project));
- }
+ }
+ if (0 != (flags & IResourceDelta.OPEN)) {
+ if (!project.isOpen() && fProjects.contains(project)) {
+ fProjects.remove(project);
+ notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_REMOVED, project));
+ } else if (project.isOpen() && hasTargetBuilder(project) && !fProjects.contains(project)) {
+ fProjects.add(project);
+ notifyListeners(new MakeTargetEvent(MakeTargetManager.this, MakeTargetEvent.PROJECT_ADDED, project));
}
- } catch (CoreException e) {
}
}
return false;
@@ -205,6 +220,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
return resource instanceof IWorkspaceRoot;
}
}
+
protected void writeTargets(ProjectTargets projectTargets) throws CoreException {
IPath targetFilePath = MakeCorePlugin.getDefault().getStateLocation().append(projectTargets.getProject().getName());
File targetFile = targetFilePath.toFile();
@@ -251,7 +267,7 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
protected void notifyListeners(MakeTargetEvent event) {
Object[] list = listeners.getListeners();
for (int i = 0; i < list.length; i++) {
- ((IMakeTargetListener) list[i]).targetChanged(event);
+ ((IMakeTargetListener)list[i]).targetChanged(event);
}
}
@@ -264,6 +280,6 @@ public class MakeTargetManager implements IMakeTargetManager, IResourceChangeLis
}
public String getBuilderID(String targetBuilderID) {
- return (String) builderMap.get(targetBuilderID);
+ return (String)builderMap.get(targetBuilderID);
}
} \ No newline at end of file
diff --git a/build/org.eclipse.cdt.make.ui/plugin.xml b/build/org.eclipse.cdt.make.ui/plugin.xml
index cd454901d9e..9727eac955f 100644
--- a/build/org.eclipse.cdt.make.ui/plugin.xml
+++ b/build/org.eclipse.cdt.make.ui/plugin.xml
@@ -89,7 +89,7 @@
</menu>
<action
label="%ActionMakeBuildCreate.label"
- class="org.eclipse.cdt.make.internal.ui.actions.MakeCreateBuildAction"
+ class="org.eclipse.cdt.make.ui.actions.CreateBuildAction"
menubarPath="org.eclipse.cdt.make.ui.menu/group1"
enablesFor="1"
id="org.eclipse.cdt.make.ui.createBuildAction">
@@ -161,7 +161,7 @@
</visibility>
<action
label="%ActionMakeUpdate.label"
- class="org.eclipse.cdt.make.internal.ui.wizards.UpdateMakeProjectAction"
+ class="org.eclipse.cdt.make.ui.actions.UpdateMakeProjectAction"
enablesFor="+"
id="org.eclipse.cdt.make.ui.UpdateProjectMakeAction">
</action>
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractMakeBuilderAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractMakeBuilderAction.java
deleted file mode 100644
index c48ecfb3e9e..00000000000
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/AbstractMakeBuilderAction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Created on 18-Aug-2003
- *
- * Copyright (c) 2002,2003 QNX Software Systems Ltd.
- *
- * Contributors:
- * QNX Software Systems - Initial API and implementation
-***********************************************************************/
-package org.eclipse.cdt.make.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.actions.ActionDelegate;
-
-public abstract class AbstractMakeBuilderAction extends ActionDelegate implements IObjectActionDelegate {
- IWorkbenchPart part;
- ISelection fSelection;
-
- public AbstractMakeBuilderAction() {
- super();
- }
-
- /**
- * @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
- */
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- part = targetPart;
- }
-
- /**
- * @see IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- fSelection = selection;
- }
-
- protected Shell getShell() {
- return part.getSite().getShell();
- }
-
-}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetDialog.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetDialog.java
new file mode 100644
index 00000000000..bb1ca428414
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/BuildTargetDialog.java
@@ -0,0 +1,140 @@
+package org.eclipse.cdt.make.ui.actions;
+
+import java.util.HashMap;
+
+import org.eclipse.cdt.make.core.IMakeBuilderInfo;
+import org.eclipse.cdt.make.core.IMakeTargetManager;
+import org.eclipse.cdt.make.core.MakeCorePlugin;
+import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
+import org.eclipse.cdt.utils.ui.controls.ControlFactory;
+import org.eclipse.cdt.utils.ui.controls.RadioButtonsArea;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class BuildTargetDialog extends TitleAreaDialog {
+ private static final String PREFIX = "SettingsBlock"; //$NON-NLS-1$
+
+ private static final String MAKE_SETTING_GROUP = PREFIX + ".makeSetting.group_label"; //$NON-NLS-1$
+ private static final String MAKE_SETTING_KEEP_GOING = PREFIX + ".makeSetting.keepOnGoing"; //$NON-NLS-1$
+ private static final String MAKE_SETTING_STOP_ERROR = PREFIX + ".makeSetting.stopOnError"; //$NON-NLS-1$
+
+ private static final String MAKE_CMD_GROUP = PREFIX + ".makeCmd.group_label"; //$NON-NLS-1$
+ private static final String MAKE_CMD_USE_DEFAULT = PREFIX + ".makeCmd.use_default"; //$NON-NLS-1$
+ private static final String MAKE_CMD_LABEL = PREFIX + ".makeCmd.label"; //$NON-NLS-1$
+
+ private static final String KEEP_ARG = "keep"; //$NON-NLS-1$
+ private static final String STOP_ARG = "stop"; //$NON-NLS-1$
+
+ RadioButtonsArea stopRadioButtons;
+ Text buildCommand;
+ Button defButton;
+
+ IMakeBuilderInfo fBuildInfo;
+ IMakeTargetManager fTargetManager;
+
+ /**
+ * @param parentShell
+ */
+ public BuildTargetDialog(Shell parentShell, IContainer container) {
+ super(parentShell);
+ fTargetManager = MakeCorePlugin.getDefault().getTargetManager();
+ String[] id = fTargetManager.getTargetBuilders(container.getProject());
+ if ( id != null) {
+ fBuildInfo = MakeCorePlugin.createBuildInfo(new HashMap(), id[0]);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ Control control = super.createDialogArea(parent);
+
+ createSettingControls(parent);
+ createBuildCmdControls(parent);
+
+ return control;
+ }
+
+ protected void createSettingControls(Composite parent) {
+ String[][] radios = new String[][] { { MakeUIPlugin.getResourceString(MAKE_SETTING_STOP_ERROR), STOP_ARG }, {
+ MakeUIPlugin.getResourceString(MAKE_SETTING_KEEP_GOING), KEEP_ARG }
+ };
+ stopRadioButtons = new RadioButtonsArea(parent, MakeUIPlugin.getResourceString(MAKE_SETTING_GROUP), 1, radios);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ stopRadioButtons.setLayout(layout);
+ if (fBuildInfo.isStopOnError())
+ stopRadioButtons.setSelectValue(STOP_ARG);
+ else
+ stopRadioButtons.setSelectValue(KEEP_ARG);
+ }
+
+ protected void createBuildCmdControls(Composite parent) {
+ Group group = ControlFactory.createGroup(parent, MakeUIPlugin.getResourceString(MAKE_CMD_GROUP), 1);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 2;
+ layout.makeColumnsEqualWidth = false;
+ layout.horizontalSpacing = 0;
+ group.setLayout(layout);
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ defButton = ControlFactory.createCheckBox(group, MakeUIPlugin.getResourceString(MAKE_CMD_USE_DEFAULT));
+ defButton.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ if (defButton.getSelection() == true) {
+ buildCommand.setEnabled(false);
+ stopRadioButtons.setEnabled(true);
+ } else {
+ buildCommand.setEnabled(true);
+ stopRadioButtons.setEnabled(false);
+ }
+ }
+ });
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ defButton.setLayoutData(gd);
+ Label label = ControlFactory.createLabel(group, MakeUIPlugin.getResourceString(MAKE_CMD_LABEL));
+ ((GridData) (label.getLayoutData())).horizontalAlignment = GridData.BEGINNING;
+ ((GridData) (label.getLayoutData())).grabExcessHorizontalSpace = false;
+ buildCommand = ControlFactory.createTextField(group, SWT.SINGLE | SWT.BORDER);
+ ((GridData) (buildCommand.getLayoutData())).horizontalAlignment = GridData.FILL;
+ ((GridData) (buildCommand.getLayoutData())).grabExcessHorizontalSpace = true;
+ buildCommand.addListener(SWT.Modify, new Listener() {
+ public void handleEvent(Event e) {
+ }
+ });
+ if (fBuildInfo.getBuildCommand() != null) {
+ StringBuffer cmd = new StringBuffer(fBuildInfo.getBuildCommand().toOSString());
+ if (!fBuildInfo.isDefaultBuildCmd()) {
+ String args = fBuildInfo.getBuildArguments();
+ if (args != null && !args.equals("")) { //$NON-NLS-1$
+ cmd.append(" "); //$NON-NLS-1$
+ cmd.append(args);
+ }
+ }
+ buildCommand.setText(cmd.toString());
+ }
+ if (fBuildInfo.isDefaultBuildCmd()) {
+ buildCommand.setEnabled(false);
+ } else {
+ stopRadioButtons.setEnabled(false);
+ }
+ defButton.setSelection(fBuildInfo.isDefaultBuildCmd());
+ }
+
+}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateBuildAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateBuildAction.java
index a928492b155..d05faa5c2f5 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateBuildAction.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/actions/CreateBuildAction.java
@@ -8,16 +8,37 @@
***********************************************************************/
package org.eclipse.cdt.make.ui.actions;
+import org.eclipse.core.resources.IContainer;
import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+import org.eclipse.ui.actions.ActionDelegate;
-public class CreateBuildAction extends AbstractMakeBuilderAction implements IWorkbenchWindowActionDelegate {
+public class CreateBuildAction extends ActionDelegate implements IObjectActionDelegate, IWorkbenchWindowActionDelegate {
+
+ IWorkbenchPart fPart;
+ IContainer fContainer;
+
+ public void run(IAction action) {
+ BuildTargetDialog dialog = new BuildTargetDialog(fPart.getSite().getShell(), fContainer);
+ dialog.open();
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ fPart = targetPart;
+ }
public void init(IWorkbenchWindow window) {
}
- public void run(IAction action) {
+ public void selectionChanged(IAction action, ISelection selection) {
+ if ( selection instanceof IStructuredSelection ) {
+ fContainer = (IContainer)((IStructuredSelection)selection).getFirstElement();
+ }
}
}
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeContentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeContentProvider.java
index d71e5cf70d1..d3254e82f16 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeContentProvider.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeContentProvider.java
@@ -39,7 +39,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
public Object[] getChildren(Object obj) {
if (obj instanceof IWorkspaceRoot) {
try {
- return MakeCorePlugin.getDefault().getTargetProvider().getTargetBuilderProjects();
+ return MakeCorePlugin.getDefault().getTargetManager().getTargetBuilderProjects();
} catch (CoreException e) {
}
} else if (obj instanceof IContainer) {
@@ -51,7 +51,7 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
children.add(resource[i]);
}
}
- children.addAll(Arrays.asList(MakeCorePlugin.getDefault().getTargetProvider().getTargets((IContainer) obj)));
+ children.addAll(Arrays.asList(MakeCorePlugin.getDefault().getTargetManager().getTargets((IContainer) obj)));
} catch (CoreException e) {
}
return children.toArray();
@@ -78,13 +78,13 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
public void dispose() {
if (viewer != null) {
- MakeCorePlugin.getDefault().getTargetProvider().removeListener(this);
+ MakeCorePlugin.getDefault().getTargetManager().removeListener(this);
}
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (this.viewer == null) {
- MakeCorePlugin.getDefault().getTargetProvider().addListener(this);
+ MakeCorePlugin.getDefault().getTargetManager().addListener(this);
}
this.viewer = (TreeViewer) viewer;
IWorkspace oldWorkspace = null;

Back to the top