1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2015-01-07 14:42:19 -08:00
parent 32cdeab66b
commit d59648bf52
4 changed files with 66 additions and 80 deletions

View file

@ -6,10 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Intel Corporation - Initial API and implementation * Intel Corporation - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.settings.model; package org.eclipse.cdt.core.settings.model;
public interface ICSourceEntry extends ICExclusionPatternPathEntry{ public interface ICSourceEntry extends ICExclusionPatternPathEntry{
} }

View file

@ -6,21 +6,20 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Intel Corporation - Initial API and implementation * Intel Corporation - Initial API and implementation
* James Blackburn (Broadcom Corp.) * James Blackburn (Broadcom Corp.)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.settings.model; package org.eclipse.cdt.core.settings.model;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
*
* This interface represents an generic element in a storage tree. These trees are rooted at * 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} * This abstract storage mechanism is used, e.g. with the {@link ICProjectDescription} and
* for storing custom data in the settings file (.cproject) or in a database * {@link ICConfigurationDescription} for storing custom data in the settings file (.cproject)
* or in a database.
* *
* @see ICSettingsStorage * @see ICSettingsStorage
* @see ICProjectDescription * @see ICProjectDescription
@ -29,7 +28,6 @@ import org.eclipse.core.runtime.CoreException;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICStorageElement { public interface ICStorageElement {
/** /**
* Return the String of attribute value for name. * Return the String of attribute value for name.
* If attribute is not found (hasAttribute(name) is false) * If attribute is not found (hasAttribute(name) is false)
@ -50,7 +48,6 @@ public interface ICStorageElement {
/** /**
* Returns a string array of attribute names * Returns a string array of attribute names
* @return String[]
*/ */
String[] getAttributeNames(); String[] getAttributeNames();
@ -104,25 +101,23 @@ public interface ICStorageElement {
boolean hasChildren(); 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(); void clear();
/** /**
* Get the name of this ICStorageElement * Returns the name of this ICStorageElement
* @return String name
*/ */
String getName(); String getName();
/** /**
* Remove the ICStorageElement from the set of child ICSotrageElements * Removes the ICStorageElement from the set of child ICSotrageElements
* @param el * @param el
*/ */
void removeChild(ICStorageElement el); void removeChild(ICStorageElement el);
/** /**
* Get the String value of this element or null if there is * Returns the String value of this element or null if there is no String value set.
* no String value set.
* *
* NB a pure whitespace value is considered to be null * NB a pure whitespace value is considered to be null
* @return String or null * @return String or null
@ -130,18 +125,17 @@ public interface ICStorageElement {
String getValue(); String getValue();
/** /**
* Set a String value on the ICStorageElement * Sets a String value on the ICStorageElement
* @param value * @param value
*/ */
void setValue(String value); void setValue(String value);
/** /**
* Import an existing ICStorageElemtn as a child of this ICStorageElement * Imports an existing ICStorageElemtn as a child of this ICStorageElement
* @param el * @param element
* @return ICStorageElement a Handle on the newly imported ICStorageElement * @return ICStorageElement a handle on the newly imported ICStorageElement
* @throws UnsupportedOperationException
*/ */
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 * 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; 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 * Tests whether this storage element is exactly equal to other
* To be equal all name, children attributes and value must be * To be equal all name, children attributes and value must be

View file

@ -258,7 +258,7 @@ public class CContainer extends Openable implements ICContainer {
name = ""; //$NON-NLS-1$ name = ""; //$NON-NLS-1$
token = null; token = null;
} }
CElement folder = (CElement)getCContainer(name); CElement folder = (CElement) getCContainer(name);
if (folder != null) { if (folder != null) {
if (token == null) { if (token == null) {
return folder.getHandleFromMemento(memento); return folder.getHandleFromMemento(memento);
@ -268,7 +268,8 @@ public class CContainer extends Openable implements ICContainer {
} }
break; break;
case CEM_TRANSLATIONUNIT: case CEM_TRANSLATIONUNIT:
if (!memento.hasMoreTokens()) return this; if (!memento.hasMoreTokens())
return this;
String tuName = memento.nextToken(); String tuName = memento.nextToken();
CElement tu = (CElement) getTranslationUnit(tuName); CElement tu = (CElement) getTranslationUnit(tuName);
if (tu != null) { if (tu != null) {

View file

@ -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) * @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 project project for which the project description is requested
* @param loadIfExists if true the method first tries to load and return the project description * @param loadIfExists if true the method first tries to load and return the project description
* from the settings file (.cproject) * from the settings file (.cproject),
* if false, the stored settings are ignored and the new (empty) project description is created * if false, the stored settings are ignored and the new (empty) project description is
* @param creating if true the created project description will be contain the true "isCdtProjectCreating" state. * created
* NOTE: in case the project already contains the project description AND its "isCdtProjectCreating" is false * @param creating if true the created project description will be contain the true
* the resulting description will be created with the false "isCdtProjectCreating" state * "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} * @return {@link ICProjectDescription}
* @throws CoreException * @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 * Returns the project description associated with this project or null if the project does not
* CDT data associated with it. * 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 * @param project
* @return a writable copy of the ICProjectDescription or null if the project does not contain the * @return a writable copy of the ICProjectDescription or null if the project does not contain
* CDT data associated with it. * the CDT data associated with it.
* Note: changes to the project description will not be reflected/used by the core * <br>Note: changes to the project description will not be reflected/used by the core
* until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called * until the {@link #setProjectDescription(IProject, ICProjectDescription)} is called.
* *
* @see #getProjectDescription(IProject, boolean) * @see #getProjectDescription(IProject, boolean)
*/ */
@ -1255,9 +1260,10 @@ public class CCorePlugin extends Plugin {
} }
/** /**
* this method is called to save/apply the project description * Called to save/apply the project description.
* the method should be called to apply changes made to 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)} * returned by the {@link #getProjectDescription(IProject, boolean)} or
* {@link #createProjectDescription(IProject, boolean)}
* *
* @param project * @param project
* @param des * @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 * Returns the project description associated with this project or null if the project
* CDT data associated with it. * does not contain the CDT data associated with it.
* *
* @param project project for which the description is requested * @param project project for which the description is requested
* @param write if true, the writable description copy is returned. * @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, * <br>CDT core maintains the cached project description settings. If only read access is needed
* then the read-only project description should be obtained. * 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 * This description always operates with cached data and thus it is better to use it for
* All set* calls to the read-only description result in the {@link WriteAccessException} * 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. * When the writable description is requested, the description copy is created. Changes to this
* Changes to this description will not be reflected/used by the core and Build System untill the * description will not be reflected/used by the core and the Build System until the
* {@link #setProjectDescription(IProject, ICProjectDescription)} is called * {@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 * after that the description communicates directly to the Build System
* i.e. the implementer of the org.eclipse.cdt.core.CConfigurationDataProvider extension * 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 * @return {@link ICProjectDescription} or null if the project does not contain the
* CDT data associated with it. * 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. * 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
* *
* @param projects * @param projects if <code>null</code>, all projects within the workspace are updated
* @param monitor * @param monitor
* @throws CoreException * @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) { public boolean isNewStyleProject(IProject project) {
return fNewCProjectDescriptionManager.isNewStyleProject(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, * @param severity - desired severity of the message in the log,
* one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR} * 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, * @param severity - desired severity of the message in the log,
* one of {@link IStatus#INFO}, {@link IStatus#WARNING} or {@link IStatus#ERROR} * 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) { public static void log(String message, Throwable e) {
Throwable nestedException; Throwable nestedException;
if (e instanceof CModelException if (e instanceof CModelException
&& (nestedException = ((CModelException)e).getException()) != null) { && (nestedException = ((CModelException) e).getException()) != null) {
e = nestedException; e = nestedException;
} }
log(createStatus(message, e)); 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. * or embedded within the resource tree of projects when they are not top level folders.
* *
* @return boolean preference value * @return boolean preference value