mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
2005-01-07 Alain Magloire
Part of Fix 82323. The "New" action was not shown when workspace was empty or no selection. * src/org/eclipse/cdt/internal/ui/cview/MainActionGroup.java And make sure we do not put problem icons on resources that !exist() && isReadOnly(). * src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java
This commit is contained in:
parent
0939d72702
commit
74ebb4ef75
3 changed files with 19 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2005-01-07 Alain Magloire
|
||||||
|
Part of Fix 82323.
|
||||||
|
The "New" action was not shown when workspace was empty
|
||||||
|
or no selection.
|
||||||
|
* src/org/eclipse/cdt/internal/ui/cview/MainActionGroup.java
|
||||||
|
And make sure we do not put problem icons on resources that !exist() && isReadOnly().
|
||||||
|
* src/org/eclipse/cdt/internal/ui/util/ResourceToItemsMapper.java
|
||||||
|
|
||||||
2005-01-07 Alain Magloire
|
2005-01-07 Alain Magloire
|
||||||
Fix PR 82202
|
Fix PR 82202
|
||||||
* src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java
|
* src/org/eclipse/cdt/internal/ui/cview/CViewDropAdapter.java
|
||||||
|
|
|
@ -79,6 +79,8 @@ public class MainActionGroup extends CViewActionGroup {
|
||||||
SelectionSearchGroup selectionSearchGroup;
|
SelectionSearchGroup selectionSearchGroup;
|
||||||
RefactoringActionGroup refactoringActionGroup;
|
RefactoringActionGroup refactoringActionGroup;
|
||||||
|
|
||||||
|
private NewWizardMenu newWizardMenu;
|
||||||
|
|
||||||
public MainActionGroup(CView cview) {
|
public MainActionGroup(CView cview) {
|
||||||
super(cview);
|
super(cview);
|
||||||
}
|
}
|
||||||
|
@ -115,6 +117,8 @@ public class MainActionGroup extends CViewActionGroup {
|
||||||
buildGroup = new BuildGroup(getCView());
|
buildGroup = new BuildGroup(getCView());
|
||||||
refactorGroup = new RefactorActionGroup(getCView());
|
refactorGroup = new RefactorActionGroup(getCView());
|
||||||
|
|
||||||
|
newWizardMenu = new NewWizardMenu(getCView().getSite().getWorkbenchWindow());
|
||||||
|
|
||||||
openIncludeAction = new OpenIncludeAction(viewer);
|
openIncludeAction = new OpenIncludeAction(viewer);
|
||||||
|
|
||||||
//sortByNameAction = new SortViewAction(this, false);
|
//sortByNameAction = new SortViewAction(this, false);
|
||||||
|
@ -167,8 +171,9 @@ public class MainActionGroup extends CViewActionGroup {
|
||||||
IStructuredSelection celements = (IStructuredSelection) getCView().getViewer().getSelection();
|
IStructuredSelection celements = (IStructuredSelection) getCView().getViewer().getSelection();
|
||||||
IStructuredSelection resources = SelectionConverter.convertSelectionToResources(celements);
|
IStructuredSelection resources = SelectionConverter.convertSelectionToResources(celements);
|
||||||
|
|
||||||
|
addNewMenu(menu, resources);
|
||||||
|
|
||||||
if (resources.isEmpty()) {
|
if (resources.isEmpty()) {
|
||||||
new NewWizardMenu(getCView().getSite().getWorkbenchWindow());
|
|
||||||
menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
|
menu.add(new Separator(IContextMenuConstants.GROUP_REORGANIZE));
|
||||||
refactoringActionGroup.fillContextMenu(menu);
|
refactoringActionGroup.fillContextMenu(menu);
|
||||||
menu.add(new Separator());
|
menu.add(new Separator());
|
||||||
|
@ -184,7 +189,6 @@ public class MainActionGroup extends CViewActionGroup {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
addNewMenu(menu, resources);
|
|
||||||
menu.add(new Separator());
|
menu.add(new Separator());
|
||||||
gotoGroup.fillContextMenu(menu);
|
gotoGroup.fillContextMenu(menu);
|
||||||
menu.add(new Separator());
|
menu.add(new Separator());
|
||||||
|
@ -223,8 +227,8 @@ public class MainActionGroup extends CViewActionGroup {
|
||||||
|
|
||||||
void addNewMenu(IMenuManager menu, IStructuredSelection selection) {
|
void addNewMenu(IMenuManager menu, IStructuredSelection selection) {
|
||||||
MenuManager newMenu = new MenuManager(CViewMessages.getString("NewWizardsActionGroup.new")); //$NON-NLS-1$
|
MenuManager newMenu = new MenuManager(CViewMessages.getString("NewWizardsActionGroup.new")); //$NON-NLS-1$
|
||||||
new NewWizardMenu(getCView().getSite().getWorkbenchWindow());
|
|
||||||
menu.add(newMenu);
|
menu.add(newMenu);
|
||||||
|
newMenu.add(newWizardMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addBookMarkMenu(IMenuManager menu, IStructuredSelection selection) {
|
void addBookMarkMenu(IMenuManager menu, IStructuredSelection selection) {
|
||||||
|
@ -339,6 +343,7 @@ public class MainActionGroup extends CViewActionGroup {
|
||||||
openProjectGroup.dispose();
|
openProjectGroup.dispose();
|
||||||
gotoGroup.dispose();
|
gotoGroup.dispose();
|
||||||
buildGroup.dispose();
|
buildGroup.dispose();
|
||||||
|
newWizardMenu.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ public class ResourceToItemsMapper {
|
||||||
private static IResource getCorrespondingResource(Object element) {
|
private static IResource getCorrespondingResource(Object element) {
|
||||||
if (element instanceof ICElement) {
|
if (element instanceof ICElement) {
|
||||||
ICElement elem= (ICElement) element;
|
ICElement elem= (ICElement) element;
|
||||||
if (!elem.isReadOnly()) { // only modifieable elements can get error ticks
|
if (elem.exists() && !elem.isReadOnly()) { // only modifieable elements can get error ticks
|
||||||
IResource res= elem.getResource();
|
IResource res= elem.getResource();
|
||||||
if (res == null) {
|
if (res == null) {
|
||||||
ITranslationUnit cu= (ITranslationUnit) elem.getAncestor(ICElement.C_UNIT);
|
ITranslationUnit cu= (ITranslationUnit) elem.getAncestor(ICElement.C_UNIT);
|
||||||
|
|
Loading…
Add table
Reference in a new issue