Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2005-05-19 01:34:11 +0000
committerDavid Inglis2005-05-19 01:34:11 +0000
commit3e98b19c1c8a3e6c43735bb9acb1247789683ef4 (patch)
tree01232c29f1d576f86303983bd6992e34596e1bf7 /build/org.eclipse.cdt.make.ui
parent5ecd43203f52acc84d196cfb1879781a975eff35 (diff)
downloadorg.eclipse.cdt-3e98b19c1c8a3e6c43735bb9acb1247789683ef4.tar.gz
org.eclipse.cdt-3e98b19c1c8a3e6c43735bb9acb1247789683ef4.tar.xz
org.eclipse.cdt-3e98b19c1c8a3e6c43735bb9acb1247789683ef4.zip
fixed bug # 69080
Diffstat (limited to 'build/org.eclipse.cdt.make.ui')
-rw-r--r--build/org.eclipse.cdt.make.ui/NEWS4
-rw-r--r--build/org.eclipse.cdt.make.ui/icons/etool16/target_filter.gifbin0 -> 345 bytes
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties22
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java3
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java125
5 files changed, 105 insertions, 49 deletions
diff --git a/build/org.eclipse.cdt.make.ui/NEWS b/build/org.eclipse.cdt.make.ui/NEWS
index c0a3cc1df22..b1871c7d00d 100644
--- a/build/org.eclipse.cdt.make.ui/NEWS
+++ b/build/org.eclipse.cdt.make.ui/NEWS
@@ -3,3 +3,7 @@ Release CDT-3.0
* All the MakefileEditor text preference settings are now common with the text editors.
To access use Window --> Preferences --> General --> Editors --> Text Editors
+ * New Environment variable support for builder.
+
+ * Can now filter folders which do not have make target in Make Target view.
+
diff --git a/build/org.eclipse.cdt.make.ui/icons/etool16/target_filter.gif b/build/org.eclipse.cdt.make.ui/icons/etool16/target_filter.gif
new file mode 100644
index 00000000000..5340ec9f417
--- /dev/null
+++ b/build/org.eclipse.cdt.make.ui/icons/etool16/target_filter.gif
Binary files differ
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
index 8a0bc654bd1..aa714b035ee 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeResources.properties
@@ -12,22 +12,13 @@
MakeCWizard.title=C/Make Project
MakeCWizard.description=Create a New C Project using 'make' to build it
MakeEnvironmentBlock.10=&Remove
-MakeEnvironmentBlock.10=&Remove
-MakeEnvironmentBlock.11=New Environment Variable
MakeEnvironmentBlock.11=New Environment Variable
MakeEnvironmentBlock.12=Overwrite variable?
-MakeEnvironmentBlock.12=Overwrite variable?
MakeEnvironmentBlock.13=A variable named {0} already exists. Overwrite?
-MakeEnvironmentBlock.13=A variable named {0} already exists. Overwrite?
-MakeEnvironmentBlock.14=Select &environment variables to add:
MakeEnvironmentBlock.14=Select &environment variables to add:
MakeEnvironmentBlock.15=Select Environment Variables
-MakeEnvironmentBlock.15=Select Environment Variables
-MakeEnvironmentBlock.16=Edit Environment Variable
MakeEnvironmentBlock.16=Edit Environment Variable
MakeEnvironmentBlock.17=&Append environment to native environment
-MakeEnvironmentBlock.17=&Append environment to native environment
-MakeEnvironmentBlock.18=Re&place native environment with specified environment
MakeEnvironmentBlock.18=Re&place native environment with specified environment
MakeCWizard.task_name=Creating C project with Make builder...
@@ -35,24 +26,14 @@ MakeCCWizard.title=C++/Make Project
MakeCCWizard.description=Create a New C++ Project using 'make' to build it
MakeCCWizard.task_name=Creating C++ project with Make builder...
MakeEnvironmentBlock.0=Variable
-MakeEnvironmentBlock.0=Variable
MakeEnvironmentBlock.1=Value
-MakeEnvironmentBlock.1=Value
-MakeEnvironmentBlock.2=&Name:
MakeEnvironmentBlock.2=&Name:
MakeEnvironmentBlock.3=&Value:
-MakeEnvironmentBlock.3=&Value:
MakeEnvironmentBlock.4=Environment
-MakeEnvironmentBlock.4=Environment
-MakeEnvironmentBlock.5=Environment used for make builder
MakeEnvironmentBlock.5=Environment used for make builder
MakeEnvironmentBlock.6=Environment variables to set
-MakeEnvironmentBlock.6=Environment variables to set
-MakeEnvironmentBlock.7=N&ew...
MakeEnvironmentBlock.7=N&ew...
MakeEnvironmentBlock.8=Se&lect...
-MakeEnvironmentBlock.8=Se&lect...
-MakeEnvironmentBlock.9=E&dit...
MakeEnvironmentBlock.9=E&dit...
MakeCWizardSettings.title=C/Make Project Settings
@@ -185,6 +166,9 @@ AddTargetAction.tooltip=Add Make Target
AddTargetAction.exception.internalError=Internal Error
AddTargetAction.=Internal Error
+FilterEmptyFolderAction.label=Hide Empty Folders
+FilterEmptyFolderAction.tooltip=Hide Empty Folders
+
# Startup messages
MakeUIPlugin.update_project=Update make projects
MakeUIPlugin.update_project_message=Older \'make\' projects have been detected in your workspace. \n These projects are no longer supported, would you like to convert these now?
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java
index 803f6e94d02..85bf7b9b98e 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeUIImages.java
@@ -48,12 +48,11 @@ public class MakeUIImages {
public static final String IMG_OBJS_ERROR = NAME_PREFIX + "error_obj.gif"; //$NON-NLS-1$
public static final ImageDescriptor DESC_OBJ_ERROR = createManaged(OBJ, IMG_OBJS_ERROR);
-
- // For the outliner label provider.
public static final String IMG_TOOLS_MAKE_TARGET_BUILD = NAME_PREFIX + "target_build.gif"; //$NON-NLS-1$
public static final String IMG_TOOLS_MAKE_TARGET_ADD = NAME_PREFIX + "target_add.gif"; //$NON-NLS-1$
public static final String IMG_TOOLS_MAKE_TARGET_DELETE = NAME_PREFIX + "target_delete.gif"; //$NON-NLS-1$
public static final String IMG_TOOLS_MAKE_TARGET_EDIT = NAME_PREFIX + "target_edit.gif"; //$NON-NLS-1$
+ public static final String IMG_TOOLS_MAKE_TARGET_FILTER = NAME_PREFIX + "target_filter.gif"; //$NON-NLS-1$
public static final String IMG_OBJS_MAKEFILE_MACRO = NAME_PREFIX + "macro_obj.gif"; //$NON-NLS-1$
public static final ImageDescriptor DESC_MAKEFILE_MACRO = createManaged(OBJ, IMG_OBJS_MAKEFILE_MACRO);
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java
index 60f4ae49d31..e2775a0b13f 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/views/MakeView.java
@@ -10,23 +10,32 @@
*******************************************************************************/
package org.eclipse.cdt.make.ui.views;
-
+import org.eclipse.cdt.make.internal.ui.MakeUIImages;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.cdt.make.ui.IMakeHelpContextIds;
import org.eclipse.cdt.make.ui.MakeContentProvider;
import org.eclipse.cdt.make.ui.MakeLabelProvider;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.IDialogSettings;
+import org.eclipse.jface.viewers.ContentViewer;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
@@ -43,45 +52,50 @@ public class MakeView extends ViewPart {
private EditTargetAction editTargetAction;
private DeleteTargetAction deleteTargetAction;
AddTargetAction addTargetAction;
- TreeViewer viewer;
+ TreeViewer fViewer;
DrillDownAdapter drillDownAdapter;
+ private Action trimEmptyFolderAction;
public MakeView() {
super();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
public void setFocus() {
- viewer.getTree().setFocus();
+ fViewer.getTree().setFocus();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
public void createPartControl(Composite parent) {
MakeUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(parent, IMakeHelpContextIds.MAKE_VIEW);
- viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- viewer.setUseHashlookup(true);
- viewer.setContentProvider(new MakeContentProvider());
- viewer.setLabelProvider(new MakeLabelProvider());
+ fViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ fViewer.setUseHashlookup(true);
+ fViewer.setContentProvider(new MakeContentProvider());
+ fViewer.setLabelProvider(new MakeLabelProvider());
- drillDownAdapter = new DrillDownAdapter(viewer);
+ drillDownAdapter = new DrillDownAdapter(fViewer);
- viewer.addDoubleClickListener(new IDoubleClickListener() {
+ fViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
handleDoubleClick(event);
}
});
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
handleSelectionChanged(event);
}
});
- viewer.getControl().addKeyListener(new KeyAdapter() {
+ fViewer.getControl().addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
@@ -90,22 +104,77 @@ public class MakeView extends ViewPart {
}
});
- viewer.setContentProvider(new MakeContentProvider());
- viewer.setLabelProvider(new MakeLabelProvider());
- viewer.setSorter(new ViewerSorter());
- viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
- getSite().setSelectionProvider(viewer);
+ fViewer.setContentProvider(new MakeContentProvider());
+ fViewer.setLabelProvider(new MakeLabelProvider());
+ fViewer.setSorter(new ViewerSorter() {
+
+ public int category(Object element) {
+ if (element instanceof IResource) {
+ return 0;
+ }
+ return 1;
+ }
+ });
+ fViewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
+ getSite().setSelectionProvider(fViewer);
makeActions();
hookContextMenu();
contributeToActionBars();
}
+ /**
+ * Returns setting for this control.
+ *
+ * @return Settings.
+ */
+ IDialogSettings getSettings() {
+ final String sectionName = "org.eclipse.cdt.internal.ui.MakeView"; //$NON-NLS-1$
+ IDialogSettings settings = MakeUIPlugin.getDefault().getDialogSettings().getSection(sectionName);
+ if (settings == null) {
+ settings = MakeUIPlugin.getDefault().getDialogSettings().addNewSection(sectionName);
+ }
+ return settings;
+ }
+
+ protected class FilterEmtpyFoldersAction extends Action {
+
+ private static final String FILTER_EMPTY_FOLDERS = "FilterEmptyFolders"; //$NON-NLS-1$
+
+ public FilterEmtpyFoldersAction() {
+ super(MakeUIPlugin.getResourceString("FilterEmptyFolderAction.label"), IAction.AS_CHECK_BOX); //$NON-NLS-1$
+ setToolTipText(MakeUIPlugin.getResourceString("FilterEmptyFolderAction.tooltip")); //$NON-NLS-1$
+ setChecked(getSettings().getBoolean(FILTER_EMPTY_FOLDERS));
+ MakeUIImages.setImageDescriptors(this, "tool16", MakeUIImages.IMG_TOOLS_MAKE_TARGET_FILTER); //$NON-NLS-1$
+ fViewer.addFilter(new ViewerFilter() {
+
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (isChecked() && element instanceof IFolder) {
+ ITreeContentProvider provider = (ITreeContentProvider) ((ContentViewer)viewer).getContentProvider();
+ Object[] children = provider.getChildren(element);
+ for (int i = 0; i < children.length; i++) {
+ if (select(viewer, element, children[i]))
+ return true;
+ }
+ return false;
+ }
+ return true;
+ }
+ });
+ }
+
+ public void run() {
+ fViewer.refresh();
+ getSettings().put(FILTER_EMPTY_FOLDERS, isChecked());
+ }
+ }
+
private void makeActions() {
- buildTargetAction = new BuildTargetAction(viewer.getControl().getShell());
- addTargetAction = new AddTargetAction(viewer.getControl().getShell());
- deleteTargetAction = new DeleteTargetAction(viewer.getControl().getShell());
- editTargetAction = new EditTargetAction(viewer.getControl().getShell());
+ buildTargetAction = new BuildTargetAction(fViewer.getControl().getShell());
+ addTargetAction = new AddTargetAction(fViewer.getControl().getShell());
+ deleteTargetAction = new DeleteTargetAction(fViewer.getControl().getShell());
+ editTargetAction = new EditTargetAction(fViewer.getControl().getShell());
+ trimEmptyFolderAction = new FilterEmtpyFoldersAction();
}
private void contributeToActionBars() {
IActionBars bars = getViewSite().getActionBars();
@@ -116,6 +185,7 @@ public class MakeView extends ViewPart {
private void fillLocalToolBar(IToolBarManager toolBar) {
drillDownAdapter.addNavigationActions(toolBar);
toolBar.add(buildTargetAction);
+ toolBar.add(trimEmptyFolderAction);
}
private void fillLocalPullDown(IMenuManager manager) {
@@ -128,12 +198,12 @@ public class MakeView extends ViewPart {
public void menuAboutToShow(IMenuManager manager) {
MakeView.this.fillContextMenu(manager);
- updateActions((IStructuredSelection)viewer.getSelection());
+ updateActions((IStructuredSelection)fViewer.getSelection());
}
});
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- // getSite().registerContextMenu(menuMgr, viewer);
+ Menu menu = menuMgr.createContextMenu(fViewer.getControl());
+ fViewer.getControl().setMenu(menu);
+ // getSite().registerContextMenu(menuMgr, viewer);
}
protected void fillContextMenu(IMenuManager manager) {
@@ -145,7 +215,7 @@ public class MakeView extends ViewPart {
drillDownAdapter.addNavigationActions(manager);
// Other plug-ins can contribute there actions here
- // manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ // manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
protected void handleDeleteKeyPressed() {
@@ -161,7 +231,6 @@ public class MakeView extends ViewPart {
updateActions(sel);
}
-
void updateActions(IStructuredSelection sel) {
addTargetAction.selectionChanged(sel);
buildTargetAction.selectionChanged(sel);

Back to the top