1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2011-03-27 04:43:53 +00:00
parent f0ded0383c
commit df89c8daab
4 changed files with 14 additions and 19 deletions

View file

@ -38,7 +38,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @noextend This interface is not intended to be extended by clients.
*/
public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISourceReference, ISourceManipulation {
/**
* Style constant for {@link #getAST(IIndex, int)}.
* Meaning: Skip function and method bodies.
@ -140,8 +139,7 @@ public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISource
IInclude createInclude(String name, boolean isStd, ICElement sibling, IProgressMonitor monitor) throws CModelException;
/**
* Creates and returns a using declaration/directive in this translation unit
*
* Creates and returns a using declaration/directive in this translation unit.
*
* @param name the name of the using
* @param monitor the progress monitor to notify
@ -154,7 +152,7 @@ public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISource
* <li> The name is not a valid package name (INVALID_NAME)
* </ul>
*/
IUsing createUsing (String name, boolean isDirective, ICElement sibling, IProgressMonitor monitor) throws CModelException;
IUsing createUsing(String name, boolean isDirective, ICElement sibling, IProgressMonitor monitor) throws CModelException;
/**
* Creates and returns a namespace in this translation unit
@ -171,7 +169,7 @@ public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISource
* <li> The name is not a valid package name (INVALID_NAME)
* </ul>
*/
INamespace createNamespace (String namespace, ICElement sibling, IProgressMonitor monitor) throws CModelException;
INamespace createNamespace(String namespace, ICElement sibling, IProgressMonitor monitor) throws CModelException;
/**
* Returns the shared working copy for this element, using the default <code>IBuffer</code>
@ -484,7 +482,7 @@ public interface ITranslationUnit extends ICElement, IParent, IOpenable, ISource
/**
* @deprecated don't use this method.
*/
@Deprecated Map<?,?> parse();
@Deprecated Map<?, ?> parse();
/**
* @deprecated, use {@link FileContent#create(ITranslationUnit)}, instead.
*/

View file

@ -495,7 +495,7 @@ public class Scribe {
public String getNewLine() {
if (lastNumberOfNewLines >= 1) {
column= 1; // ensure that the scribe is at the beginning of a new line
column= 1; // Ensure that the scribe is at the beginning of a new line
return EMPTY_STRING;
}
line++;

View file

@ -146,10 +146,11 @@ public abstract class CPreview {
// update the tab size
final int tabSize= getPositiveIntValue(fWorkingValues.get(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE), 0);
if (tabSize != fTabSize) fSourceViewer.getTextWidget().setTabs(tabSize);
if (tabSize != fTabSize)
fSourceViewer.getTextWidget().setTabs(tabSize);
fTabSize= tabSize;
final StyledText widget= (StyledText)fSourceViewer.getControl();
final StyledText widget= (StyledText) fSourceViewer.getControl();
final int height= widget.getClientArea().height;
final int top0= widget.getTopPixel();
@ -163,7 +164,7 @@ public abstract class CPreview {
final int totalPixels1= getHeightOfAllLines(widget);
final int topPixelRange1= totalPixels1 > height ? totalPixels1 - height : 0;
final int top1= topPixelRange0 > 0 ? (int)(topPixelRange1 * top0 / (double)topPixelRange0) : 0;
final int top1= topPixelRange0 > 0 ? (int) (topPixelRange1 * top0 / (double) topPixelRange0) : 0;
widget.setTopPixel(top1);
widget.setRedraw(true);
}

View file

@ -33,8 +33,6 @@ import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
* @author AChapiro
*/
public class CFormattingStrategy extends ContextBasedFormattingStrategy {
/** Documents to be formatted by this strategy */
private final LinkedList<IDocument> fDocuments= new LinkedList<IDocument>();
/** Partitions to be formatted by this strategy */
@ -60,7 +58,7 @@ public class CFormattingStrategy extends ContextBasedFormattingStrategy {
if (document != null && partition != null) {
try {
@SuppressWarnings("unchecked")
final Map<String,String> preferences = getPreferences();
final Map<String, String> preferences = getPreferences();
final TextEdit edit = CodeFormatterUtil.format(
CodeFormatter.K_TRANSLATION_UNIT, document.get(),
partition.getOffset(), partition.getLength(), 0,
@ -69,13 +67,12 @@ public class CFormattingStrategy extends ContextBasedFormattingStrategy {
if (edit != null)
edit.apply(document);
} catch (MalformedTreeException exception) {
CUIPlugin.log(exception);
} catch (BadLocationException exception) {
} catch (MalformedTreeException e) {
CUIPlugin.log(e);
} catch (BadLocationException e) {
// Can only happen on concurrent document modification - log and
// bail out
CUIPlugin.log(exception);
CUIPlugin.log(e);
}
}
}
@ -107,5 +104,4 @@ public class CFormattingStrategy extends ContextBasedFormattingStrategy {
fPartitions.clear();
fDocuments.clear();
}
}