mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Disabled Add Folder/File button in CPathIncludeSymbolEntryPerFilePage.
This commit is contained in:
parent
957665c172
commit
6783d23fa3
3 changed files with 31 additions and 35 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2005-07-06 Vladimir Hirsl
|
||||||
|
Disabled Add Folder/File button in CPathIncludeSymbolEntryPerFilePage.
|
||||||
|
|
||||||
|
* src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathEntryMessages.properties
|
||||||
|
* src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathIncludeSymbolEntryPerFilePage.java
|
||||||
|
|
||||||
2005-07-06 Alain Magloire
|
2005-07-06 Alain Magloire
|
||||||
Fix PR 99130: no leading underscore in the guard header name
|
Fix PR 99130: no leading underscore in the guard header name
|
||||||
* src/org/eclipse/cdt/internal/ui/wizards/filewizard/NewSourceFIleGenerator.java
|
* src/org/eclipse/cdt/internal/ui/wizards/filewizard/NewSourceFIleGenerator.java
|
||||||
|
|
|
@ -67,7 +67,6 @@ IncludeSymbolEntryPage.export=Export
|
||||||
IncludeSymbolEntryPage.up=Up
|
IncludeSymbolEntryPage.up=Up
|
||||||
IncludeSymbolEntryPage.down=Down
|
IncludeSymbolEntryPage.down=Down
|
||||||
IncludeSymbolsEntryPage.show_inherited.check=Show Inherited Paths
|
IncludeSymbolsEntryPage.show_inherited.check=Show Inherited Paths
|
||||||
IncludeSymbolsEntryPage.show_unrelated.check=Show Unrelated Resources
|
|
||||||
IncludeSymbolEntryPage.addSymbol.title=Add Preprocessor Symbol
|
IncludeSymbolEntryPage.addSymbol.title=Add Preprocessor Symbol
|
||||||
IncludeSymbolEntryPage.addSymbol.message=Symbol definition:
|
IncludeSymbolEntryPage.addSymbol.message=Symbol definition:
|
||||||
IncludeSymbolEntryPage.editSymbol.title=Edit Preprocessor Symbol
|
IncludeSymbolEntryPage.editSymbol.title=Edit Preprocessor Symbol
|
||||||
|
|
|
@ -71,7 +71,6 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
|
|
||||||
private TreeListDialogField fIncludeSymPathsList;
|
private TreeListDialogField fIncludeSymPathsList;
|
||||||
private SelectionButtonDialogField fShowInheritedPaths;
|
private SelectionButtonDialogField fShowInheritedPaths;
|
||||||
private SelectionButtonDialogField fShowUnrelatedResources;
|
|
||||||
private ICElement fCurrCElement;
|
private ICElement fCurrCElement;
|
||||||
private ICProject fCurrCProject;
|
private ICProject fCurrCProject;
|
||||||
private CPElementFilter fFilter;
|
private CPElementFilter fFilter;
|
||||||
|
@ -91,7 +90,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
|
|
||||||
private static final String[] buttonLabel = new String[]{
|
private static final String[] buttonLabel = new String[]{
|
||||||
|
|
||||||
/* 0 */CPathEntryMessages.getString("IncludeSymbolEntryPage.addFolderFile"), //$NON-NLS-1$
|
/* 0 */CPathEntryMessages.getString("IncludeSymbolEntryPage.addFolderFile"), //$NON-NLS-1$
|
||||||
null,
|
null,
|
||||||
/* 2 */CPathEntryMessages.getString("IncludeSymbolEntryPage.addUserSymbol"), //$NON-NLS-1$
|
/* 2 */CPathEntryMessages.getString("IncludeSymbolEntryPage.addUserSymbol"), //$NON-NLS-1$
|
||||||
null,
|
null,
|
||||||
|
@ -115,39 +114,35 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
private class CPElementPerFileFilter extends CPElementFilter {
|
private class CPElementPerFileFilter extends CPElementFilter {
|
||||||
private boolean fShowUnrelated;
|
|
||||||
|
|
||||||
public CPElementPerFileFilter(int[] kind, boolean exportedOnly, boolean showInherited, boolean showUnrelated) {
|
public CPElementPerFileFilter(int[] kind, boolean exportedOnly, boolean showInherited) {
|
||||||
super(kind, exportedOnly, showInherited);
|
super(kind, exportedOnly, showInherited);
|
||||||
fShowUnrelated = showUnrelated;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.internal.ui.dialogs.cpaths.CPElementFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
* @see org.eclipse.cdt.internal.ui.dialogs.cpaths.CPElementFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
||||||
*/
|
*/
|
||||||
public boolean select(Viewer viewer, Object parent, Object element) {
|
public boolean select(Viewer viewer, Object parent, Object element) {
|
||||||
if (!fShowUnrelated) {
|
IResource res = null;
|
||||||
IResource res = null;
|
if (element instanceof CPElement) {
|
||||||
if (element instanceof CPElement) {
|
CPElement cpElem = (CPElement) element;
|
||||||
CPElement cpElem = (CPElement) element;
|
res = cpElem.getResource();
|
||||||
res = cpElem.getResource();
|
} else if (element instanceof CPElementGroup) {
|
||||||
} else if (element instanceof CPElementGroup) {
|
CPElementGroup cpElemGroup = (CPElementGroup) element;
|
||||||
CPElementGroup cpElemGroup = (CPElementGroup) element;
|
res = cpElemGroup.getResource();
|
||||||
res = cpElemGroup.getResource();
|
}
|
||||||
}
|
if (res != null && !res.equals(fCurrCElement.getResource())) {
|
||||||
if (res != null && !res.equals(fCurrCElement.getResource())) {
|
IPath currResPath = fCurrCElement.getResource().getFullPath();
|
||||||
IPath currResPath = fCurrCElement.getResource().getFullPath();
|
IPath resPath = res.getFullPath();
|
||||||
IPath resPath = res.getFullPath();
|
boolean found = false;
|
||||||
boolean found = false;
|
for (int i = currResPath.segmentCount() - 1; i >= 0; --i) {
|
||||||
for (int i = currResPath.segmentCount() - 1; i >= 0; --i) {
|
if (resPath.equals(currResPath.uptoSegment(i))) {
|
||||||
if (resPath.equals(currResPath.uptoSegment(i))) {
|
found = true;
|
||||||
found = true;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (found == false)
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
if (found == false)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return super.select(viewer, parent, element);
|
return super.select(viewer, parent, element);
|
||||||
}
|
}
|
||||||
|
@ -222,6 +217,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fIncludeSymPathsList.setLabelText(CPathEntryMessages.getString("IncludeSymbolEntryPage.label")); //$NON-NLS-1$
|
fIncludeSymPathsList.setLabelText(CPathEntryMessages.getString("IncludeSymbolEntryPage.label")); //$NON-NLS-1$
|
||||||
|
fIncludeSymPathsList.enableButton(IDX_ADD_FOLDER_FILE, false);
|
||||||
fIncludeSymPathsList.enableButton(IDX_REMOVE, false);
|
fIncludeSymPathsList.enableButton(IDX_REMOVE, false);
|
||||||
fIncludeSymPathsList.enableButton(IDX_EDIT, false);
|
fIncludeSymPathsList.enableButton(IDX_EDIT, false);
|
||||||
fIncludeSymPathsList.enableButton(IDX_ADD_CONTRIBUTED, true);
|
fIncludeSymPathsList.enableButton(IDX_ADD_CONTRIBUTED, true);
|
||||||
|
@ -236,14 +232,10 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
fShowInheritedPaths.setSelection(true);
|
fShowInheritedPaths.setSelection(true);
|
||||||
fShowInheritedPaths.setLabelText(CPathEntryMessages.getString("IncludeSymbolsEntryPage.show_inherited.check")); //$NON-NLS-1$
|
fShowInheritedPaths.setLabelText(CPathEntryMessages.getString("IncludeSymbolsEntryPage.show_inherited.check")); //$NON-NLS-1$
|
||||||
fShowInheritedPaths.setDialogFieldListener(adapter);
|
fShowInheritedPaths.setDialogFieldListener(adapter);
|
||||||
fShowUnrelatedResources = new SelectionButtonDialogField(SWT.CHECK);
|
|
||||||
fShowUnrelatedResources.setSelection(false);
|
|
||||||
fShowUnrelatedResources.setLabelText(CPathEntryMessages.getString("IncludeSymbolsEntryPage.show_unrelated.check")); //$NON-NLS-1$
|
|
||||||
fShowUnrelatedResources.setDialogFieldListener(adapter);
|
|
||||||
|
|
||||||
fFilter = new CPElementPerFileFilter(new int[]{-1, IPathEntry.CDT_INCLUDE, IPathEntry.CDT_INCLUDE_FILE,
|
fFilter = new CPElementPerFileFilter(new int[]{-1, IPathEntry.CDT_INCLUDE, IPathEntry.CDT_INCLUDE_FILE,
|
||||||
IPathEntry.CDT_MACRO, IPathEntry.CDT_MACRO_FILE, IPathEntry.CDT_CONTAINER},
|
IPathEntry.CDT_MACRO, IPathEntry.CDT_MACRO_FILE, IPathEntry.CDT_CONTAINER},
|
||||||
false, true, false);
|
false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createControl(Composite parent) {
|
public void createControl(Composite parent) {
|
||||||
|
@ -252,7 +244,7 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
Composite composite = new Composite(parent, SWT.NONE);
|
Composite composite = new Composite(parent, SWT.NONE);
|
||||||
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||||
|
|
||||||
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fIncludeSymPathsList, fShowInheritedPaths, fShowUnrelatedResources}, true);
|
LayoutUtil.doDefaultLayout(composite, new DialogField[]{fIncludeSymPathsList, fShowInheritedPaths}, true);
|
||||||
LayoutUtil.setHorizontalGrabbing(fIncludeSymPathsList.getTreeControl(null));
|
LayoutUtil.setHorizontalGrabbing(fIncludeSymPathsList.getTreeControl(null));
|
||||||
|
|
||||||
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
int buttonBarWidth = converter.convertWidthInCharsToPixels(24);
|
||||||
|
@ -738,14 +730,13 @@ public class CPathIncludeSymbolEntryPerFilePage extends CPathIncludeSymbolEntryB
|
||||||
|
|
||||||
protected void listPageDialogFieldChanged(DialogField field) {
|
protected void listPageDialogFieldChanged(DialogField field) {
|
||||||
boolean showInherited = fShowInheritedPaths.isSelected();
|
boolean showInherited = fShowInheritedPaths.isSelected();
|
||||||
boolean showUnrelated = fShowUnrelatedResources.isSelected();
|
if (field == fShowInheritedPaths) {
|
||||||
if (field == fShowInheritedPaths || field == fShowUnrelatedResources) {
|
|
||||||
if (fFilter != null) {
|
if (fFilter != null) {
|
||||||
fIncludeSymPathsList.getTreeViewer().removeFilter(fFilter);
|
fIncludeSymPathsList.getTreeViewer().removeFilter(fFilter);
|
||||||
}
|
}
|
||||||
fFilter = new CPElementPerFileFilter(new int[]{-1, IPathEntry.CDT_INCLUDE, IPathEntry.CDT_INCLUDE_FILE,
|
fFilter = new CPElementPerFileFilter(new int[]{-1, IPathEntry.CDT_INCLUDE, IPathEntry.CDT_INCLUDE_FILE,
|
||||||
IPathEntry.CDT_MACRO, IPathEntry.CDT_MACRO_FILE, IPathEntry.CDT_CONTAINER},
|
IPathEntry.CDT_MACRO, IPathEntry.CDT_MACRO_FILE, IPathEntry.CDT_CONTAINER},
|
||||||
false, showInherited, showUnrelated);
|
false, showInherited);
|
||||||
fIncludeSymPathsList.getTreeViewer().addFilter(fFilter);
|
fIncludeSymPathsList.getTreeViewer().addFilter(fFilter);
|
||||||
fIncludeSymPathsList.setTreeExpansionLevel(fTreeExpansionLevel);
|
fIncludeSymPathsList.setTreeExpansionLevel(fTreeExpansionLevel);
|
||||||
fIncludeSymPathsList.refresh();
|
fIncludeSymPathsList.refresh();
|
||||||
|
|
Loading…
Add table
Reference in a new issue