Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Krasilnikov2008-03-04 12:13:06 +0000
committerOleg Krasilnikov2008-03-04 12:13:06 +0000
commit83a13921acd9226a7bab847717fc309ad6ec8f45 (patch)
tree138769c187d7356c5e3a833810013abb8836aa1f /core/org.eclipse.cdt.core/model/org
parent879d4c36616138cc20c8808a9c58ac94cff8aad4 (diff)
downloadorg.eclipse.cdt-83a13921acd9226a7bab847717fc309ad6ec8f45.tar.gz
org.eclipse.cdt-83a13921acd9226a7bab847717fc309ad6ec8f45.tar.xz
org.eclipse.cdt-83a13921acd9226a7bab847717fc309ad6ec8f45.zip
Fix: apply in Multi-config mode
Diffstat (limited to 'core/org.eclipse.cdt.core/model/org')
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMultiResourceDescription.java2
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java37
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiResourceDescription.java4
3 files changed, 33 insertions, 10 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMultiResourceDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMultiResourceDescription.java
index bdabbe0d635..0fc221a0cdb 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMultiResourceDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/ICMultiResourceDescription.java
@@ -14,5 +14,5 @@ import java.util.List;
public interface ICMultiResourceDescription extends ICResourceDescription, ICMultiItemsHolder {
- void setSettingEntries(ICLanguageSetting lang, int kind, List incs, boolean toAll);
+ void setSettingEntries(ICLanguageSetting lang, int kind, List<ICLanguageSettingEntry> incs, boolean toAll);
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java
index 3afba0e19c4..44b091943ed 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/MultiItemsHolder.java
@@ -11,6 +11,8 @@
package org.eclipse.cdt.core.settings.model;
import org.eclipse.cdt.internal.core.settings.model.MultiConfigDescription;
+import org.eclipse.cdt.internal.core.settings.model.MultiFileDescription;
+import org.eclipse.cdt.internal.core.settings.model.MultiFolderDescription;
/**
*
@@ -35,13 +37,6 @@ public abstract class MultiItemsHolder implements ICMultiItemsHolder {
*
* @param rds - array of cfg.descs
*
- * @param mode - string list display and write mode
- * @see DMODE_CONJUNCTION
- * @see DMODE_EMPTY
- * @see DMODE_ALL
- * @see WMODE_DIFF
- * @see WMODE_CURRENT
- *
* @return multiple cfg.description or single cfg.desc.
*/
public static ICConfigurationDescription createCDescription(ICConfigurationDescription[] rds) {
@@ -52,4 +47,32 @@ public abstract class MultiItemsHolder implements ICMultiItemsHolder {
else
return new MultiConfigDescription(rds);
}
+ /**
+ * This method is put here to prevent UI from
+ * accessing constructors in "internal" dirs.
+ *
+ * Creates multiple resource description, it
+ * can be either MultiFile or MultiFolder.
+ * If there's 1 description in array,
+ * it's returned itself.
+ *
+ * @param rds - array of resource descs
+ *
+ * @return multiple res.description or single res.desc.
+ */
+ public static ICResourceDescription createRDescription(ICResourceDescription[] rds) {
+ if (rds == null || rds.length == 0)
+ return null;
+ else if (rds.length == 1)
+ return rds[0];
+ else if (rds[0] instanceof ICFolderDescription) {
+ ICFolderDescription[] fds = new ICFolderDescription[rds.length];
+ System.arraycopy(rds, 0, fds, 0, rds.length);
+ return new MultiFolderDescription(fds);
+ } else {
+ ICFileDescription[] fds = new ICFileDescription[rds.length];
+ System.arraycopy(rds, 0, fds, 0, rds.length);
+ return new MultiFileDescription(fds);
+ }
+ }
}
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiResourceDescription.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiResourceDescription.java
index 2279a073df8..e66f28be29a 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiResourceDescription.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/settings/model/MultiResourceDescription.java
@@ -16,6 +16,7 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICFileDescription;
import org.eclipse.cdt.core.settings.model.ICFolderDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
+import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICMultiResourceDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.core.settings.model.ICSettingContainer;
@@ -190,8 +191,7 @@ public abstract class MultiResourceDescription extends MultiItemsHolder implemen
return fRess;
}
- @SuppressWarnings("unchecked")
- public void setSettingEntries(ICLanguageSetting lang, int kind, List incs, boolean toAll) {
+ public void setSettingEntries(ICLanguageSetting lang, int kind, List<ICLanguageSettingEntry> incs, boolean toAll) {
for (int i=0; i<fRess.length; i++) {
if (fRess[i] instanceof ICFolderDescription) {
String n = lang.getName();

Back to the top