mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 322695: Can't access preferences of any unrelated CDT project having "bad" project in workspace
This commit is contained in:
parent
cb668b62b8
commit
cb1a62793d
3 changed files with 36 additions and 26 deletions
|
@ -216,10 +216,11 @@ public class Messages extends NLS {
|
||||||
public static String ProjectContentsArea_7;
|
public static String ProjectContentsArea_7;
|
||||||
public static String ProjectContentsArea_8;
|
public static String ProjectContentsArea_8;
|
||||||
public static String ProjectContentsArea_9;
|
public static String ProjectContentsArea_9;
|
||||||
public static String RefsTab_0;
|
public static String RefsTab_ExpandAll;
|
||||||
public static String RefsTab_2;
|
public static String RefsTab_CollapseAll;
|
||||||
public static String RefsTab_3;
|
public static String RefsTab_Active;
|
||||||
public static String RefsTab_4;
|
public static String RefsTab_ProjectsList;
|
||||||
|
public static String RefsTab_ConfigurationsAccessError;
|
||||||
public static String RenameConfiguration_error_caseName;
|
public static String RenameConfiguration_error_caseName;
|
||||||
public static String RenameConfiguration_error_duplicateName;
|
public static String RenameConfiguration_error_duplicateName;
|
||||||
public static String RenameConfiguration_error_invalidName;
|
public static String RenameConfiguration_error_invalidName;
|
||||||
|
|
|
@ -165,10 +165,11 @@ LibraryPathTab_1=Add...
|
||||||
LibraryPathTab_2=Edit...
|
LibraryPathTab_2=Edit...
|
||||||
LibraryTab_1=Add...
|
LibraryTab_1=Add...
|
||||||
LibraryTab_2=Edit...
|
LibraryTab_2=Edit...
|
||||||
RefsTab_0=Expand All
|
RefsTab_ExpandAll=Expand All
|
||||||
RefsTab_2=Collapse All
|
RefsTab_CollapseAll=Collapse All
|
||||||
RefsTab_3=Active
|
RefsTab_Active=Active
|
||||||
RefsTab_4=Projects list
|
RefsTab_ProjectsList=Projects list
|
||||||
|
RefsTab_ConfigurationsAccessError=Internal error trying access configurations of project
|
||||||
SymbolTab_0=Symbol
|
SymbolTab_0=Symbol
|
||||||
SymbolTab_1=Value
|
SymbolTab_1=Value
|
||||||
SymbolTab_2=Add symbol
|
SymbolTab_2=Add symbol
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.TreeItem;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||||
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.newui.Messages;
|
import org.eclipse.cdt.internal.ui.newui.Messages;
|
||||||
|
|
||||||
|
@ -52,7 +53,7 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
public Composite comp;
|
public Composite comp;
|
||||||
private Tree tree;
|
private Tree tree;
|
||||||
|
|
||||||
static private final String ACTIVE = "[" + Messages.RefsTab_3 + "]"; //$NON-NLS-1$ //$NON-NLS-2$
|
static private final String ACTIVE = "[" + Messages.RefsTab_Active + "]"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
private static final int EXPAND_ALL_BUTTON = 0;
|
private static final int EXPAND_ALL_BUTTON = 0;
|
||||||
private static final int COLLAPSE_ALL_BUTTON = 1;
|
private static final int COLLAPSE_ALL_BUTTON = 1;
|
||||||
|
@ -63,8 +64,8 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
public void createControls(Composite parent) {
|
public void createControls(Composite parent) {
|
||||||
super.createControls(parent);
|
super.createControls(parent);
|
||||||
initButtons(new String[] {
|
initButtons(new String[] {
|
||||||
Messages.RefsTab_0,
|
Messages.RefsTab_ExpandAll,
|
||||||
Messages.RefsTab_2,
|
Messages.RefsTab_CollapseAll,
|
||||||
null,
|
null,
|
||||||
MOVEUP_STR,
|
MOVEUP_STR,
|
||||||
MOVEDOWN_STR}, 120);
|
MOVEDOWN_STR}, 120);
|
||||||
|
@ -76,7 +77,7 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
new AccessibleAdapter() {
|
new AccessibleAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void getName(AccessibleEvent e) {
|
public void getName(AccessibleEvent e) {
|
||||||
e.result = Messages.RefsTab_4;
|
e.result = Messages.RefsTab_ProjectsList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -253,8 +254,15 @@ public class RefsTab extends AbstractCPropertyTab {
|
||||||
for (String pname : projects) {
|
for (String pname : projects) {
|
||||||
// The referenced configuration ID
|
// The referenced configuration ID
|
||||||
String ref = refs.get(pname);
|
String ref = refs.get(pname);
|
||||||
IProject prj = p.getWorkspace().getRoot().getProject(pname);
|
IProject prj;
|
||||||
ICConfigurationDescription[] cfgs = page.getCfgsReadOnly(prj);
|
ICConfigurationDescription[] cfgs;
|
||||||
|
try {
|
||||||
|
prj = p.getWorkspace().getRoot().getProject(pname);
|
||||||
|
cfgs = page.getCfgsReadOnly(prj);
|
||||||
|
} catch (Exception e) {
|
||||||
|
CUIPlugin.log(Messages.RefsTab_ConfigurationsAccessError+pname, e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (cfgs == null || cfgs.length == 0) {
|
if (cfgs == null || cfgs.length == 0) {
|
||||||
// If the project is referenced, then make sure the user knows about it!
|
// If the project is referenced, then make sure the user knows about it!
|
||||||
if (ref != null) {
|
if (ref != null) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue