1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Cosmetics.

Change-Id: I8c38ac32c7cb4e335e16b92a54eeaf6faa0abfe2
This commit is contained in:
Sergey Prigogin 2017-02-06 19:37:44 -08:00
parent d6ab03abb9
commit ff23fc9dbe

View file

@ -10,6 +10,7 @@
* QNX Software System * QNX Software System
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
* Anton Leherbauer (Wind River Systems) * Anton Leherbauer (Wind River Systems)
* Sergey Prigogin (Google)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.ui.editor; package org.eclipse.cdt.internal.ui.editor;
@ -153,13 +154,12 @@ public abstract class AbstractCModelOutlinePage extends Page
if (node instanceof Item) { if (node instanceof Item) {
Item i= (Item) node; Item i= (Item) node;
final Object data = i.getData(); final Object data = i.getData();
// don't expand include grouping by default // Don't expand include grouping by default.
if (data instanceof IncludesGrouping) { if (data instanceof IncludesGrouping) {
return; return;
} else if (data instanceof ICElement) {
if (!shouldExpandElement((ICElement)data)) {
return;
} }
if (data instanceof ICElement && !shouldExpandElement((ICElement) data)) {
return;
} }
} }
super.internalExpandToLevel(node, level); super.internalExpandToLevel(node, level);
@ -198,9 +198,6 @@ public abstract class AbstractCModelOutlinePage extends Page
fOutLinePage = outlinePage; fOutLinePage = outlinePage;
} }
/**
* Runs the action.
*/
@Override @Override
public void run() { public void run() {
PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.OUTLINE_GROUP_INCLUDES, isChecked()); PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.OUTLINE_GROUP_INCLUDES, isChecked());
@ -212,7 +209,7 @@ public abstract class AbstractCModelOutlinePage extends Page
} }
/** /**
* This action toggles macro grouping * This action toggles macro grouping.
* *
* @since 5.2 * @since 5.2
*/ */
@ -231,9 +228,6 @@ public abstract class AbstractCModelOutlinePage extends Page
setChecked(enabled); setChecked(enabled);
} }
/**
* Runs the action.
*/
@Override @Override
public void run() { public void run() {
PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.OUTLINE_GROUP_MACROS, isChecked()); PreferenceConstants.getPreferenceStore().setValue(PreferenceConstants.OUTLINE_GROUP_MACROS, isChecked());
@ -258,9 +252,6 @@ public abstract class AbstractCModelOutlinePage extends Page
setChecked(isLinkingEnabled()); setChecked(isLinkingEnabled());
} }
/**
* Runs the action.
*/
@Override @Override
public void run() { public void run() {
boolean checked = isChecked(); boolean checked = isChecked();
@ -277,7 +268,8 @@ public abstract class AbstractCModelOutlinePage extends Page
protected ITextEditor fEditor; protected ITextEditor fEditor;
protected ITranslationUnit fInput; protected ITranslationUnit fInput;
private ProblemTreeViewer fTreeViewer; private ProblemTreeViewer fTreeViewer;
private ListenerList fSelectionChangedListeners = new ListenerList(ListenerList.IDENTITY); private ListenerList<ISelectionChangedListener> fSelectionChangedListeners =
new ListenerList<>(ListenerList.IDENTITY);
protected TogglePresentationAction fTogglePresentation; protected TogglePresentationAction fTogglePresentation;
protected String fContextMenuId; protected String fContextMenuId;
private Menu fMenu; private Menu fMenu;
@ -336,7 +328,7 @@ public abstract class AbstractCModelOutlinePage extends Page
} }
/** /**
* Returns the <code>IShowInSource</code> for this view. * Returns the {@code IShowInSource} for this view.
* *
* @return the {@link IShowInSource} * @return the {@link IShowInSource}
*/ */
@ -344,15 +336,13 @@ public abstract class AbstractCModelOutlinePage extends Page
return new IShowInSource() { return new IShowInSource() {
@Override @Override
public ShowInContext getShowInContext() { public ShowInContext getShowInContext() {
return new ShowInContext( return new ShowInContext(null, getSite().getSelectionProvider().getSelection());
null,
getSite().getSelectionProvider().getSelection());
} }
}; };
} }
/** /**
* Returns the <code>IShowInTarget</code> for this view. * Returns the {@code IShowInTarget} for this view.
* *
* @return the {@link IShowInTarget} * @return the {@link IShowInTarget}
*/ */
@ -619,8 +609,7 @@ public abstract class AbstractCModelOutlinePage extends Page
} }
/** /**
* return an ActionGroup contributing search actions or * return an ActionGroup contributing search actions or {@code null} if search is not supported
* <code>null</code> if search is not supported
*/ */
protected ActionGroup createSearchActionGroup() { protected ActionGroup createSearchActionGroup() {
// default: no search action group // default: no search action group
@ -629,7 +618,7 @@ public abstract class AbstractCModelOutlinePage extends Page
/** /**
* @return an OpenViewActionGroup contributing open view actions or * @return an OpenViewActionGroup contributing open view actions or
* <code>null</code> if open view actions are not wanted * {@code null} if open view actions are not wanted
*/ */
protected ActionGroup createOpenViewActionGroup() { protected ActionGroup createOpenViewActionGroup() {
// default: no open view action group // default: no open view action group
@ -638,7 +627,7 @@ public abstract class AbstractCModelOutlinePage extends Page
/** /**
* @return an ActionGroup contributing refactoring actions or * @return an ActionGroup contributing refactoring actions or
* <code>null</code> if refactoring is not supported * {@code null} if refactoring is not supported
*/ */
protected ActionGroup createRefactoringActionGroup() { protected ActionGroup createRefactoringActionGroup() {
// default: no refactoring actions // default: no refactoring actions
@ -647,7 +636,7 @@ public abstract class AbstractCModelOutlinePage extends Page
/** /**
* @return an ActionGroup contributing source actions or * @return an ActionGroup contributing source actions or
* <code>null</code> if source actions are not supported * {@code null} if source actions are not supported
*/ */
protected ActionGroup createSourceActionGroup() { protected ActionGroup createSourceActionGroup() {
// default: no source actions // default: no source actions
@ -656,7 +645,7 @@ public abstract class AbstractCModelOutlinePage extends Page
/** /**
* @return an ActionGroup instance to provide custom filters or * @return an ActionGroup instance to provide custom filters or
* <code>null</code> if this action group is not wanted * {@code null} if this action group is not wanted
*/ */
protected ActionGroup createCustomFiltersActionGroup() { protected ActionGroup createCustomFiltersActionGroup() {
// default: no custom filters // default: no custom filters
@ -664,7 +653,7 @@ public abstract class AbstractCModelOutlinePage extends Page
} }
/** /**
* @return an ActionGroup contributing member filters or <code>null</code> * @return an ActionGroup contributing member filters or {@code null}
* if member filters are not wanted * if member filters are not wanted
*/ */
protected ActionGroup createMemberFilterActionGroup() { protected ActionGroup createMemberFilterActionGroup() {
@ -683,10 +672,10 @@ public abstract class AbstractCModelOutlinePage extends Page
* @param selection the new selection * @param selection the new selection
*/ */
protected void fireSelectionChanged(ISelection selection) { protected void fireSelectionChanged(ISelection selection) {
// create an event // Create an event.
SelectionChangedEvent event = new SelectionChangedEvent(this, selection); SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
// fire the event // Fire the event.
Object[] listeners = fSelectionChangedListeners.getListeners(); Object[] listeners = fSelectionChangedListeners.getListeners();
for (int i = 0; i < listeners.length; ++i) { for (int i = 0; i < listeners.length; ++i) {
((ISelectionChangedListener) listeners[i]).selectionChanged(event); ((ISelectionChangedListener) listeners[i]).selectionChanged(event);
@ -719,8 +708,7 @@ public abstract class AbstractCModelOutlinePage extends Page
/** /**
* Returns this page's tree viewer. * Returns this page's tree viewer.
* *
* @return this page's tree viewer, or <code>null</code> if * @return this page's tree viewer, or {@code null} if {@code createControl} has not been called yet
* <code>createControl</code> has not been called yet
*/ */
protected TreeViewer getTreeViewer() { protected TreeViewer getTreeViewer() {
return fTreeViewer; return fTreeViewer;
@ -767,13 +755,13 @@ public abstract class AbstractCModelOutlinePage extends Page
LocalSelectionTransfer.getTransfer() LocalSelectionTransfer.getTransfer()
}; };
// Drop Adapter // Drop adapter.
TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] { TransferDropTargetListener[] dropListeners= new TransferDropTargetListener[] {
new SelectionTransferDropAdapter(fTreeViewer) new SelectionTransferDropAdapter(fTreeViewer)
}; };
fTreeViewer.addDropSupport(ops | DND.DROP_DEFAULT, transfers, new DelegatingDropAdapter(dropListeners)); fTreeViewer.addDropSupport(ops | DND.DROP_DEFAULT, transfers, new DelegatingDropAdapter(dropListeners));
// Drag Adapter // Drag adapter.
TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] { TransferDragSourceListener[] dragListeners= new TransferDragSourceListener[] {
new SelectionTransferDragAdapter(fTreeViewer) new SelectionTransferDragAdapter(fTreeViewer)
}; };