mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
a840d359aa
commit
74d3d47147
3 changed files with 10 additions and 20 deletions
|
@ -76,7 +76,6 @@ public abstract class CPreview {
|
|||
};
|
||||
|
||||
public CSourcePreviewerUpdater() {
|
||||
|
||||
JFaceResources.getFontRegistry().addListener(fontListener);
|
||||
fPreferenceStore.addPropertyChangeListener(propertyListener);
|
||||
|
||||
|
@ -190,8 +189,6 @@ public abstract class CPreview {
|
|||
return defaultValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Map<String, String> getWorkingValues() {
|
||||
return fWorkingValues;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
* IBM Corporation - initial API and implementation
|
||||
* Anton Leherbauer (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.ui.preferences.formatter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -28,11 +27,9 @@ import org.eclipse.cdt.internal.corext.util.CodeFormatterUtil;
|
|||
|
||||
import org.eclipse.cdt.internal.ui.ICStatusConstants;
|
||||
|
||||
|
||||
public class SnippetPreview extends CPreview {
|
||||
|
||||
public final static class PreviewSnippet {
|
||||
|
||||
public String header;
|
||||
public final String source;
|
||||
public final int kind;
|
||||
|
@ -64,7 +61,8 @@ public class SnippetPreview extends CPreview {
|
|||
for (PreviewSnippet snippet: fSnippets) {
|
||||
String formattedSource;
|
||||
try {
|
||||
TextEdit edit= CodeFormatterUtil.format(snippet.kind, snippet.source, 0, delimiter, fWorkingValues);
|
||||
TextEdit edit= CodeFormatterUtil.format(snippet.kind, snippet.source, 0, delimiter,
|
||||
fWorkingValues);
|
||||
if (edit == null) {
|
||||
formattedSource= snippet.source;
|
||||
} else {
|
||||
|
@ -73,7 +71,8 @@ public class SnippetPreview extends CPreview {
|
|||
formattedSource= document.get();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
final IStatus status= new Status(IStatus.ERROR, CUIPlugin.getPluginId(), ICStatusConstants.INTERNAL_ERROR,
|
||||
final IStatus status= new Status(IStatus.ERROR, CUIPlugin.getPluginId(),
|
||||
ICStatusConstants.INTERNAL_ERROR,
|
||||
FormatterMessages.CPreview_formatter_exception, e);
|
||||
CUIPlugin.log(status);
|
||||
continue;
|
||||
|
@ -86,8 +85,6 @@ public class SnippetPreview extends CPreview {
|
|||
fPreviewDocument.set(buffer.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void add(PreviewSnippet snippet) {
|
||||
fSnippets.add(snippet);
|
||||
}
|
||||
|
@ -103,5 +100,4 @@ public class SnippetPreview extends CPreview {
|
|||
public void clear() {
|
||||
fSnippets.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
* Sergey Prigogin, Google
|
||||
* Anton Leherbauer (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.ui.preferences.formatter;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -31,9 +30,7 @@ import org.eclipse.cdt.ui.CUIPlugin;
|
|||
|
||||
import org.eclipse.cdt.internal.ui.ICStatusConstants;
|
||||
|
||||
|
||||
public class TranslationUnitPreview extends CPreview {
|
||||
|
||||
private String fPreviewText;
|
||||
private String fFormatterId;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue