mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-30 21:55:31 +02:00
Cosmetics.
This commit is contained in:
parent
32cdeab66b
commit
d59648bf52
4 changed files with 66 additions and 80 deletions
|
@ -6,10 +6,9 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
* Intel Corporation - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.settings.model;
|
||||
|
||||
|
||||
public interface ICSourceEntry extends ICExclusionPatternPathEntry{
|
||||
}
|
||||
|
|
|
@ -6,21 +6,20 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Intel Corporation - Initial API and implementation
|
||||
* James Blackburn (Broadcom Corp.)
|
||||
* Intel Corporation - Initial API and implementation
|
||||
* James Blackburn (Broadcom Corp.)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.settings.model;
|
||||
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* This interface represents an generic element in a storage tree. These trees are rooted at
|
||||
* {@link ICSettingsStorage} Elements.
|
||||
* {@link ICSettingsStorage} elements.
|
||||
*
|
||||
* This abstract storage mechanism is used, e.g. with the {@link ICProjectDescription} and {@link ICConfigurationDescription}
|
||||
* for storing custom data in the settings file (.cproject) or in a database
|
||||
* This abstract storage mechanism is used, e.g. with the {@link ICProjectDescription} and
|
||||
* {@link ICConfigurationDescription} for storing custom data in the settings file (.cproject)
|
||||
* or in a database.
|
||||
*
|
||||
* @see ICSettingsStorage
|
||||
* @see ICProjectDescription
|
||||
|
@ -29,7 +28,6 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface ICStorageElement {
|
||||
|
||||
/**
|
||||
* Return the String of attribute value for name.
|
||||
* If attribute is not found (hasAttribute(name) is false)
|
||||
|
@ -50,7 +48,6 @@ public interface ICStorageElement {
|
|||
|
||||
/**
|
||||
* Returns a string array of attribute names
|
||||
* @return String[]
|
||||
*/
|
||||
String[] getAttributeNames();
|
||||
|
||||
|
@ -104,25 +101,23 @@ public interface ICStorageElement {
|
|||
boolean hasChildren();
|
||||
|
||||
/**
|
||||
* Erase all children, attributes and any value set on this ICStorageElement
|
||||
* Erases all children, attributes and any value set on this ICStorageElement
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* Get the name of this ICStorageElement
|
||||
* @return String name
|
||||
* Returns the name of this ICStorageElement
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Remove the ICStorageElement from the set of child ICSotrageElements
|
||||
* Removes the ICStorageElement from the set of child ICSotrageElements
|
||||
* @param el
|
||||
*/
|
||||
void removeChild(ICStorageElement el);
|
||||
|
||||
/**
|
||||
* Get the String value of this element or null if there is
|
||||
* no String value set.
|
||||
* Returns the String value of this element or null if there is no String value set.
|
||||
*
|
||||
* NB a pure whitespace value is considered to be null
|
||||
* @return String or null
|
||||
|
@ -130,18 +125,17 @@ public interface ICStorageElement {
|
|||
String getValue();
|
||||
|
||||
/**
|
||||
* Set a String value on the ICStorageElement
|
||||
* Sets a String value on the ICStorageElement
|
||||
* @param value
|
||||
*/
|
||||
void setValue(String value);
|
||||
|
||||
/**
|
||||
* Import an existing ICStorageElemtn as a child of this ICStorageElement
|
||||
* @param el
|
||||
* @return ICStorageElement a Handle on the newly imported ICStorageElement
|
||||
* @throws UnsupportedOperationException
|
||||
* Imports an existing ICStorageElemtn as a child of this ICStorageElement
|
||||
* @param element
|
||||
* @return ICStorageElement a handle on the newly imported ICStorageElement
|
||||
*/
|
||||
ICStorageElement importChild(ICStorageElement el) throws UnsupportedOperationException;
|
||||
ICStorageElement importChild(ICStorageElement element) throws UnsupportedOperationException;
|
||||
|
||||
/**
|
||||
* Create a deep copy of the current ICStorageElement such that name, children, attributes and value
|
||||
|
@ -158,20 +152,6 @@ public interface ICStorageElement {
|
|||
*/
|
||||
ICStorageElement createCopy() throws UnsupportedOperationException, CoreException;
|
||||
|
||||
/**
|
||||
* Returns an ICSettingsStorage from this storage element.
|
||||
*
|
||||
* A setting storage is like a storage element except it represents the root of a tree.
|
||||
* As such it can't contain a value or any children which are not storageModule
|
||||
* ICStorageElements (otherwise they would not be accessible via the ICSettingsStorage interface)
|
||||
*
|
||||
* @param readOnly indicates whether the returned settings storage tree should be readonly
|
||||
* @return ICSettingStorage which is this ICStorageElement as a storageModule root
|
||||
* @throws CoreException if this ICStorageElement isn't a suitable root
|
||||
* @throws UnsupportedOperationException if this hierarchy doesn't support ICSettingsStorage
|
||||
*/
|
||||
// ICSettingsStorage createSettingStorage(boolean readOnly) throws CoreException, UnsupportedOperationException;
|
||||
|
||||
/**
|
||||
* Tests whether this storage element is exactly equal to other
|
||||
* To be equal all name, children attributes and value must be
|
||||
|
|
|
@ -258,7 +258,7 @@ public class CContainer extends Openable implements ICContainer {
|
|||
name = ""; //$NON-NLS-1$
|
||||
token = null;
|
||||
}
|
||||
CElement folder = (CElement)getCContainer(name);
|
||||
CElement folder = (CElement) getCContainer(name);
|
||||
if (folder != null) {
|
||||
if (token == null) {
|
||||
return folder.getHandleFromMemento(memento);
|
||||
|
@ -268,7 +268,8 @@ public class CContainer extends Openable implements ICContainer {
|
|||
}
|
||||
break;
|
||||
case CEM_TRANSLATIONUNIT:
|
||||
if (!memento.hasMoreTokens()) return this;
|
||||
if (!memento.hasMoreTokens())
|
||||
return this;
|
||||
String tuName = memento.nextToken();
|
||||
CElement tu = (CElement) getTranslationUnit(tuName);
|
||||
if (tu != null) {
|
||||
|
|
|
@ -1209,7 +1209,7 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* this method is a full equivalent to <code>createProjectDescription(IProject, boolean, false)</code>.
|
||||
* Equivalent to <code>createProjectDescription(IProject, boolean, false)</code>.
|
||||
*
|
||||
* @see #createProjectDescription(IProject, boolean, boolean)
|
||||
*/
|
||||
|
@ -1218,17 +1218,21 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* the method creates and returns a writable project description
|
||||
* Creates and returns a writable project description.
|
||||
*
|
||||
* @param project project for which the project description is requested
|
||||
* @param loadIfExists if true the method first tries to load and return the project description
|
||||
* from the settings file (.cproject)
|
||||
* if false, the stored settings are ignored and the new (empty) project description is created
|
||||
* @param creating if true the created project description will be contain the true "isCdtProjectCreating" state.
|
||||
* NOTE: in case the project already contains the project description AND its "isCdtProjectCreating" is false
|
||||
* the resulting description will be created with the false "isCdtProjectCreating" state
|
||||
* from the settings file (.cproject),
|
||||
* if false, the stored settings are ignored and the new (empty) project description is
|
||||
* created
|
||||
* @param creating if true the created project description will be contain the true
|
||||
* "isCdtProjectCreating" state.
|
||||
* <br>NOTE: in case the project already contains the project description AND its
|
||||
* "isCdtProjectCreating" is false the resulting description will be created with the false
|
||||
* "isCdtProjectCreating" state.
|
||||
*
|
||||
* NOTE: changes made to the returned project description will not be applied until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called
|
||||
* <br>NOTE: changes made to the returned project description will not be applied until
|
||||
* the {@link #setProjectDescription(IProject, ICProjectDescription)} is called.
|
||||
* @return {@link ICProjectDescription}
|
||||
* @throws CoreException
|
||||
*/
|
||||
|
@ -1237,16 +1241,17 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* returns the project description associated with this project or null if the project does not contain the
|
||||
* CDT data associated with it.
|
||||
* Returns the project description associated with this project or null if the project does not
|
||||
* contain the CDT data associated with it.
|
||||
*
|
||||
* This is a convenience method fully equivalent to getProjectDescription(project, true)
|
||||
* see {@link #getProjectDescription(IProject, boolean)} for more detail.
|
||||
*
|
||||
* this is a convenience method fully equivalent to getProjectDescription(project, true)
|
||||
* see {@link #getProjectDescription(IProject, boolean)} for more detail
|
||||
* @param project
|
||||
* @return a writable copy of the ICProjectDescription or null if the project does not contain the
|
||||
* CDT data associated with it.
|
||||
* Note: changes to the project description will not be reflected/used by the core
|
||||
* until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called
|
||||
* @return a writable copy of the ICProjectDescription or null if the project does not contain
|
||||
* the CDT data associated with it.
|
||||
* <br>Note: changes to the project description will not be reflected/used by the core
|
||||
* until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called.
|
||||
*
|
||||
* @see #getProjectDescription(IProject, boolean)
|
||||
*/
|
||||
|
@ -1255,9 +1260,10 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* this method is called to save/apply the project description
|
||||
* the method should be called to apply changes made to the project description
|
||||
* returned by the {@link #getProjectDescription(IProject, boolean)} or {@link #createProjectDescription(IProject, boolean)}
|
||||
* Called to save/apply the project description.
|
||||
* The method should be called to apply changes made to the project description
|
||||
* returned by the {@link #getProjectDescription(IProject, boolean)} or
|
||||
* {@link #createProjectDescription(IProject, boolean)}
|
||||
*
|
||||
* @param project
|
||||
* @param des
|
||||
|
@ -1275,28 +1281,29 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* returns the project description associated with this project or null if the project does not contain the
|
||||
* CDT data associated with it.
|
||||
* Returns the project description associated with this project or null if the project
|
||||
* does not contain the CDT data associated with it.
|
||||
*
|
||||
* @param project project for which the description is requested
|
||||
* @param write if true, the writable description copy is returned.
|
||||
* If false the cached read-only description is returned.
|
||||
* If false the cached read-only description is returned.
|
||||
*
|
||||
* CDT core maintains the cached project description settings. If only read access is needed to description,
|
||||
* then the read-only project description should be obtained.
|
||||
* This description always operates with cached data and thus it is better to use it for performance reasons
|
||||
* All set* calls to the read-only description result in the {@link WriteAccessException}
|
||||
* <br>CDT core maintains the cached project description settings. If only read access is needed
|
||||
* to description, then the read-only project description should be obtained.
|
||||
* This description always operates with cached data and thus it is better to use it for
|
||||
* performance reasons. All set* calls to the read-only description result in
|
||||
* the {@link WriteAccessException}.
|
||||
*
|
||||
* When the writable description is requested, the description copy is created.
|
||||
* Changes to this description will not be reflected/used by the core and Build System untill the
|
||||
* {@link #setProjectDescription(IProject, ICProjectDescription)} is called
|
||||
* When the writable description is requested, the description copy is created. Changes to this
|
||||
* description will not be reflected/used by the core and the Build System until the
|
||||
* {@link #setProjectDescription(IProject, ICProjectDescription)} is called.
|
||||
*
|
||||
* Each getProjectDescription(project, true) returns a new copy of the project description
|
||||
* Each getProjectDescription(project, true) returns a new copy of the project description.
|
||||
*
|
||||
* The writable description uses the cached data untill the first set call
|
||||
* The writable description uses the cached data until the first set call
|
||||
* after that the description communicates directly to the Build System
|
||||
* i.e. the implementer of the org.eclipse.cdt.core.CConfigurationDataProvider extension
|
||||
* This ensures the Core<->Build System settings integrity
|
||||
* This ensures the Core<->Build System settings integrity.
|
||||
*
|
||||
* @return {@link ICProjectDescription} or null if the project does not contain the
|
||||
* CDT data associated with it.
|
||||
|
@ -1306,11 +1313,9 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* forces the cached data of the specified projects to be re-calculated.
|
||||
* if the <code>projects</code> argument is <code>null</code> al projects
|
||||
* within the workspace are updated
|
||||
* Forces the cached data of the specified projects to be re-calculated.
|
||||
*
|
||||
* @param projects
|
||||
* @param projects if <code>null</code>, all projects within the workspace are updated
|
||||
* @param monitor
|
||||
* @throws CoreException
|
||||
*/
|
||||
|
@ -1319,7 +1324,8 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Answers whether the given project is a new-style project, i.e. CConfigurationDataProvider-driven
|
||||
* Answers whether the given project is a new-style project, i.e.
|
||||
* CConfigurationDataProvider-driven.
|
||||
*/
|
||||
public boolean isNewStyleProject(IProject project) {
|
||||
return fNewCProjectDescriptionManager.isNewStyleProject(project);
|
||||
|
@ -1361,7 +1367,7 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Print a message in the log
|
||||
* Prints a message in the log
|
||||
*
|
||||
* @param severity - desired severity of the message in the log,
|
||||
* one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR}
|
||||
|
@ -1375,7 +1381,7 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Print a message in the log accompanied by stack trace
|
||||
* Prints a message in the log accompanied by stack trace
|
||||
*
|
||||
* @param severity - desired severity of the message in the log,
|
||||
* one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR}
|
||||
|
@ -1406,7 +1412,7 @@ public class CCorePlugin extends Plugin {
|
|||
public static void log(String message, Throwable e) {
|
||||
Throwable nestedException;
|
||||
if (e instanceof CModelException
|
||||
&& (nestedException = ((CModelException)e).getException()) != null) {
|
||||
&& (nestedException = ((CModelException) e).getException()) != null) {
|
||||
e = nestedException;
|
||||
}
|
||||
log(createStatus(message, e));
|
||||
|
@ -1443,7 +1449,7 @@ public class CCorePlugin extends Plugin {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns preference controlling whether source roots are shown at the top of projects
|
||||
* Returns the preference controlling whether source roots are shown at the top of projects
|
||||
* or embedded within the resource tree of projects when they are not top level folders.
|
||||
*
|
||||
* @return boolean preference value
|
||||
|
|
Loading…
Add table
Reference in a new issue