mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
f8f7aea5d4
commit
c1a87bc4a7
1 changed files with 11 additions and 15 deletions
|
@ -93,13 +93,12 @@ import org.eclipse.cdt.internal.ui.viewsupport.DecoratingCLabelProvider;
|
||||||
*
|
*
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractCModelOutlinePage extends Page implements IContentOutlinePage, ISelectionChangedListener, IAdaptable {
|
public abstract class AbstractCModelOutlinePage extends Page
|
||||||
|
implements IContentOutlinePage, ISelectionChangedListener, IAdaptable {
|
||||||
/**
|
/**
|
||||||
* The default label provider for the outline.
|
* The default label provider for the outline.
|
||||||
*/
|
*/
|
||||||
public static class COutlineLabelProvider extends AppearanceAwareLabelProvider {
|
public static class COutlineLabelProvider extends AppearanceAwareLabelProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag whether to show member definitions with qualified or simple names.
|
* Flag whether to show member definitions with qualified or simple names.
|
||||||
*/
|
*/
|
||||||
|
@ -148,9 +147,7 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
public OutlineTreeViewer(Composite parent, int flags) {
|
public OutlineTreeViewer(Composite parent, int flags) {
|
||||||
super(parent, flags);
|
super(parent, flags);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* @see TreeViewer#internalExpandToLevel
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected void internalExpandToLevel(Widget node, int level) {
|
protected void internalExpandToLevel(Widget node, int level) {
|
||||||
if (node instanceof Item) {
|
if (node instanceof Item) {
|
||||||
|
@ -213,7 +210,6 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
public boolean isIncludesGroupingEnabled () {
|
public boolean isIncludesGroupingEnabled () {
|
||||||
return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.OUTLINE_GROUP_INCLUDES);
|
return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.OUTLINE_GROUP_INCLUDES);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -247,7 +243,6 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
public boolean isMacroGroupingEnabled () {
|
public boolean isMacroGroupingEnabled () {
|
||||||
return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.OUTLINE_GROUP_MACROS);
|
return PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.OUTLINE_GROUP_MACROS);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,7 +252,6 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public class ToggleLinkingAction extends AbstractToggleLinkingAction {
|
public class ToggleLinkingAction extends AbstractToggleLinkingAction {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a new action.
|
* Constructs a new action.
|
||||||
*/
|
*/
|
||||||
|
@ -277,7 +271,9 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final long TEXT_FLAGS = AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS | CElementLabels.F_APP_TYPE_SIGNATURE | CElementLabels.M_APP_RETURNTYPE;
|
private static final long TEXT_FLAGS =
|
||||||
|
AppearanceAwareLabelProvider.DEFAULT_TEXTFLAGS | CElementLabels.F_APP_TYPE_SIGNATURE |
|
||||||
|
CElementLabels.M_APP_RETURNTYPE;
|
||||||
private static final int IMAGE_FLAGS = AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS;
|
private static final int IMAGE_FLAGS = AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS;
|
||||||
protected ITextEditor fEditor;
|
protected ITextEditor fEditor;
|
||||||
protected ITranslationUnit fInput;
|
protected ITranslationUnit fInput;
|
||||||
|
@ -374,7 +370,7 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
int offset= tsel.getOffset();
|
int offset= tsel.getOffset();
|
||||||
ICElement element= null;
|
ICElement element= null;
|
||||||
if (fEditor instanceof CEditor) {
|
if (fEditor instanceof CEditor) {
|
||||||
element= ((CEditor)fEditor).getElementAt(offset, false);
|
element= ((CEditor) fEditor).getElementAt(offset, false);
|
||||||
} else if (fInput != null) {
|
} else if (fInput != null) {
|
||||||
try {
|
try {
|
||||||
element= fInput.getElementAtOffset(offset);
|
element= fInput.getElementAtOffset(offset);
|
||||||
|
@ -407,11 +403,11 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
* Sets the selected element to the one at the current cursor position in the editor.
|
* Sets the selected element to the one at the current cursor position in the editor.
|
||||||
*/
|
*/
|
||||||
public void synchronizeSelectionWithEditor() {
|
public void synchronizeSelectionWithEditor() {
|
||||||
if(fInput == null || fEditor == null || fTreeViewer == null)
|
if (fInput == null || fEditor == null || fTreeViewer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ITextSelection editorSelection = (ITextSelection) fEditor.getSelectionProvider().getSelection();
|
ITextSelection editorSelection = (ITextSelection) fEditor.getSelectionProvider().getSelection();
|
||||||
if(editorSelection == null)
|
if (editorSelection == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int offset = editorSelection.getOffset();
|
int offset = editorSelection.getOffset();
|
||||||
|
@ -513,7 +509,8 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
site.setSelectionProvider(fTreeViewer);
|
site.setSelectionProvider(fTreeViewer);
|
||||||
|
|
||||||
IActionBars bars= site.getActionBars();
|
IActionBars bars= site.getActionBars();
|
||||||
bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY, fTogglePresentation);
|
bars.setGlobalActionHandler(ITextEditorActionDefinitionIds.TOGGLE_SHOW_SELECTED_ELEMENT_ONLY,
|
||||||
|
fTogglePresentation);
|
||||||
|
|
||||||
fSelectionSearchGroup = createSearchActionGroup();
|
fSelectionSearchGroup = createSearchActionGroup();
|
||||||
fOpenViewActionGroup = createOpenViewActionGroup();
|
fOpenViewActionGroup = createOpenViewActionGroup();
|
||||||
|
@ -786,5 +783,4 @@ public abstract class AbstractCModelOutlinePage extends Page implements IContent
|
||||||
};
|
};
|
||||||
fTreeViewer.addDragSupport(ops, transfers, new CDTViewerDragAdapter(fTreeViewer, dragListeners));
|
fTreeViewer.addDragSupport(ops, transfers, new CDTViewerDragAdapter(fTreeViewer, dragListeners));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue