mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
@Override annotations
This commit is contained in:
parent
032d94ff51
commit
c099f67da4
23 changed files with 361 additions and 283 deletions
|
@ -188,18 +188,21 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
||||||
/* (non-Cdoc)
|
/* (non-Cdoc)
|
||||||
* Method declared on IContentProvider.
|
* Method declared on IContentProvider.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Cdoc)
|
/* (non-Cdoc)
|
||||||
* Method declared on IContentProvider.
|
* Method declared on IContentProvider.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Cdoc)
|
/* (non-Cdoc)
|
||||||
* Method declared on IStructuredContentProvider.
|
* Method declared on IStructuredContentProvider.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object[] getElements(Object parent) {
|
public Object[] getElements(Object parent) {
|
||||||
return getChildren(parent);
|
return getChildren(parent);
|
||||||
}
|
}
|
||||||
|
@ -207,6 +210,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
||||||
/* (non-Cdoc)
|
/* (non-Cdoc)
|
||||||
* Method declared on ITreeContentProvider.
|
* Method declared on ITreeContentProvider.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object[] getChildren(Object element) {
|
public Object[] getChildren(Object element) {
|
||||||
if (!exists(element))
|
if (!exists(element))
|
||||||
return NO_CHILDREN;
|
return NO_CHILDREN;
|
||||||
|
@ -263,6 +267,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
||||||
*
|
*
|
||||||
* @see ITreeContentProvider
|
* @see ITreeContentProvider
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hasChildren(Object element) {
|
public boolean hasChildren(Object element) {
|
||||||
if (fProvideMembers) {
|
if (fProvideMembers) {
|
||||||
// assume TUs and binary files are never empty
|
// assume TUs and binary files are never empty
|
||||||
|
@ -315,6 +320,7 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
|
||||||
/* (non-Cdoc)
|
/* (non-Cdoc)
|
||||||
* Method declared on ITreeContentProvider.
|
* Method declared on ITreeContentProvider.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getParent(Object element) {
|
public Object getParent(Object element) {
|
||||||
if (!exists(element)) {
|
if (!exists(element)) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -25,6 +25,7 @@ public class CActionFilter implements IActionFilter {
|
||||||
public CActionFilter() {
|
public CActionFilter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean testAttribute(Object target, String name, String value) {
|
public boolean testAttribute(Object target, String name, String value) {
|
||||||
ICElement element = (ICElement) target;
|
ICElement element = (ICElement) target;
|
||||||
IResource resource = element.getResource();
|
IResource resource = element.getResource();
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class CElementAdapterFactory implements IAdapterFactory {
|
||||||
/**
|
/**
|
||||||
* @see CElementAdapterFactory#getAdapterList
|
* @see CElementAdapterFactory#getAdapterList
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Class<?>[] getAdapterList() {
|
public Class<?>[] getAdapterList() {
|
||||||
return PROPERTIES;
|
return PROPERTIES;
|
||||||
}
|
}
|
||||||
|
@ -54,6 +55,7 @@ public class CElementAdapterFactory implements IAdapterFactory {
|
||||||
/**
|
/**
|
||||||
* @see CElementAdapterFactory#getAdapter
|
* @see CElementAdapterFactory#getAdapter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public Object getAdapter(Object element, Class key) {
|
public Object getAdapter(Object element, Class key) {
|
||||||
ICElement celem = (ICElement) element;
|
ICElement celem = (ICElement) element;
|
||||||
|
|
|
@ -11,13 +11,14 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui;
|
package org.eclipse.cdt.internal.ui;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
|
||||||
import org.eclipse.jface.viewers.IBasicPropertyConstants;
|
import org.eclipse.jface.viewers.IBasicPropertyConstants;
|
||||||
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
import org.eclipse.ui.views.properties.IPropertyDescriptor;
|
||||||
import org.eclipse.ui.views.properties.IPropertySource;
|
import org.eclipse.ui.views.properties.IPropertySource;
|
||||||
import org.eclipse.ui.views.properties.PropertyDescriptor;
|
import org.eclipse.ui.views.properties.PropertyDescriptor;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
public class CElementPropertySource implements IPropertySource {
|
public class CElementPropertySource implements IPropertySource {
|
||||||
|
|
||||||
private final static String LABEL= "CElementProperties.name"; //$NON-NLS-1$
|
private final static String LABEL= "CElementProperties.name"; //$NON-NLS-1$
|
||||||
|
@ -43,6 +44,7 @@ public class CElementPropertySource implements IPropertySource {
|
||||||
/**
|
/**
|
||||||
* @see IPropertySource#getPropertyDescriptors
|
* @see IPropertySource#getPropertyDescriptors
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IPropertyDescriptor[] getPropertyDescriptors() {
|
public IPropertyDescriptor[] getPropertyDescriptors() {
|
||||||
return fgPropertyDescriptors;
|
return fgPropertyDescriptors;
|
||||||
}
|
}
|
||||||
|
@ -50,6 +52,7 @@ public class CElementPropertySource implements IPropertySource {
|
||||||
/**
|
/**
|
||||||
* @see IPropertySource#getPropertyValue
|
* @see IPropertySource#getPropertyValue
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getPropertyValue(Object name) {
|
public Object getPropertyValue(Object name) {
|
||||||
if (name.equals(IBasicPropertyConstants.P_TEXT)) {
|
if (name.equals(IBasicPropertyConstants.P_TEXT)) {
|
||||||
return fCElement.getElementName();
|
return fCElement.getElementName();
|
||||||
|
@ -60,12 +63,14 @@ public class CElementPropertySource implements IPropertySource {
|
||||||
/**
|
/**
|
||||||
* @see IPropertySource#setPropertyValue
|
* @see IPropertySource#setPropertyValue
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPropertyValue(Object name, Object value) {
|
public void setPropertyValue(Object name, Object value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see IPropertySource#getEditableValue
|
* @see IPropertySource#getEditableValue
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getEditableValue() {
|
public Object getEditableValue() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -73,6 +78,7 @@ public class CElementPropertySource implements IPropertySource {
|
||||||
/**
|
/**
|
||||||
* @see IPropertySource#isPropertySet
|
* @see IPropertySource#isPropertySet
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isPropertySet(Object property) {
|
public boolean isPropertySet(Object property) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -80,6 +86,7 @@ public class CElementPropertySource implements IPropertySource {
|
||||||
/**
|
/**
|
||||||
* @see IPropertySource#resetPropertyValue
|
* @see IPropertySource#resetPropertyValue
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void resetPropertyValue(Object property) {
|
public void resetPropertyValue(Object property) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui;
|
package org.eclipse.cdt.internal.ui;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.wizards.CWizardRegistry;
|
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
|
||||||
import org.eclipse.search.ui.NewSearchUI;
|
import org.eclipse.search.ui.NewSearchUI;
|
||||||
import org.eclipse.ui.IFolderLayout;
|
import org.eclipse.ui.IFolderLayout;
|
||||||
import org.eclipse.ui.IPageLayout;
|
import org.eclipse.ui.IPageLayout;
|
||||||
|
@ -21,6 +19,10 @@ import org.eclipse.ui.IPerspectiveFactory;
|
||||||
import org.eclipse.ui.console.IConsoleConstants;
|
import org.eclipse.ui.console.IConsoleConstants;
|
||||||
import org.eclipse.ui.navigator.resources.ProjectExplorer;
|
import org.eclipse.ui.navigator.resources.ProjectExplorer;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.ui.wizards.CWizardRegistry;
|
||||||
|
|
||||||
public class CPerspectiveFactory implements IPerspectiveFactory {
|
public class CPerspectiveFactory implements IPerspectiveFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,6 +35,7 @@ public class CPerspectiveFactory implements IPerspectiveFactory {
|
||||||
/**
|
/**
|
||||||
* @see IPerspectiveFactory#createInitialLayout
|
* @see IPerspectiveFactory#createInitialLayout
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void createInitialLayout(IPageLayout layout) {
|
public void createInitialLayout(IPageLayout layout) {
|
||||||
String editorArea = layout.getEditorArea();
|
String editorArea = layout.getEditorArea();
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class CProjectAdapterFactory implements IAdapterFactory {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
|
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
||||||
if (IProject.class.equals(adapterType)) {
|
if (IProject.class.equals(adapterType)) {
|
||||||
|
@ -39,6 +40,7 @@ public class CProjectAdapterFactory implements IAdapterFactory {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
|
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Class<?>[] getAdapterList() {
|
public Class<?>[] getAdapterList() {
|
||||||
return ADAPTERS;
|
return ADAPTERS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,14 +12,16 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui;
|
package org.eclipse.cdt.internal.ui;
|
||||||
|
|
||||||
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
|
import org.eclipse.ui.model.IWorkbenchAdapter;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CModelException;
|
import org.eclipse.cdt.core.model.CModelException;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.IParent;
|
import org.eclipse.cdt.core.model.IParent;
|
||||||
import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider;
|
|
||||||
import org.eclipse.cdt.ui.CElementLabelProvider;
|
import org.eclipse.cdt.ui.CElementLabelProvider;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
|
||||||
import org.eclipse.ui.model.IWorkbenchAdapter;
|
import org.eclipse.cdt.internal.ui.viewsupport.CElementImageProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of the IWorkbenchAdapter for CElements.
|
* An implementation of the IWorkbenchAdapter for CElements.
|
||||||
|
@ -38,6 +40,7 @@ public class CWorkbenchAdapter implements IWorkbenchAdapter {
|
||||||
/**
|
/**
|
||||||
* @see IWorkbenchAdapter#getChildren
|
* @see IWorkbenchAdapter#getChildren
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object[] getChildren(Object o) {
|
public Object[] getChildren(Object o) {
|
||||||
if (o instanceof IParent) {
|
if (o instanceof IParent) {
|
||||||
try {
|
try {
|
||||||
|
@ -55,6 +58,7 @@ public class CWorkbenchAdapter implements IWorkbenchAdapter {
|
||||||
/**
|
/**
|
||||||
* @see IWorkbenchAdapter#getImageDescriptor
|
* @see IWorkbenchAdapter#getImageDescriptor
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ImageDescriptor getImageDescriptor(Object element) {
|
public ImageDescriptor getImageDescriptor(Object element) {
|
||||||
if (element instanceof ICElement) {
|
if (element instanceof ICElement) {
|
||||||
return fImageProvider.getCImageDescriptor(
|
return fImageProvider.getCImageDescriptor(
|
||||||
|
@ -67,6 +71,7 @@ public class CWorkbenchAdapter implements IWorkbenchAdapter {
|
||||||
/**
|
/**
|
||||||
* @see IWorkbenchAdapter#getLabel
|
* @see IWorkbenchAdapter#getLabel
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getLabel(Object o) {
|
public String getLabel(Object o) {
|
||||||
if (o instanceof ICElement) {
|
if (o instanceof ICElement) {
|
||||||
return fLabelProvider.getText(o);
|
return fLabelProvider.getText(o);
|
||||||
|
@ -77,6 +82,7 @@ public class CWorkbenchAdapter implements IWorkbenchAdapter {
|
||||||
/**
|
/**
|
||||||
* @see IWorkbenchAdapter#getParent
|
* @see IWorkbenchAdapter#getParent
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Object getParent(Object o) {
|
public Object getParent(Object o) {
|
||||||
if (o instanceof ICElement) {
|
if (o instanceof ICElement) {
|
||||||
return ((ICElement) o).getParent();
|
return ((ICElement) o).getParent();
|
||||||
|
|
|
@ -10,13 +10,14 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui;
|
package org.eclipse.cdt.internal.ui;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
|
||||||
import org.eclipse.cdt.core.model.IParent;
|
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||||
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
|
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
|
||||||
import org.eclipse.ui.progress.IElementCollector;
|
import org.eclipse.ui.progress.IElementCollector;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
|
import org.eclipse.cdt.core.model.IParent;
|
||||||
|
|
||||||
public class DeferredCWorkbenchAdapter extends CWorkbenchAdapter implements IDeferredWorkbenchAdapter {
|
public class DeferredCWorkbenchAdapter extends CWorkbenchAdapter implements IDeferredWorkbenchAdapter {
|
||||||
|
|
||||||
private ICElement fCElement;
|
private ICElement fCElement;
|
||||||
|
@ -33,6 +34,7 @@ public class DeferredCWorkbenchAdapter extends CWorkbenchAdapter implements IDef
|
||||||
* org.eclipse.jface.progress.IElementCollector,
|
* org.eclipse.jface.progress.IElementCollector,
|
||||||
* org.eclipse.core.runtime.IProgressMonitor)
|
* org.eclipse.core.runtime.IProgressMonitor)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
|
public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
|
||||||
Object[] children = getChildren(object);
|
Object[] children = getChildren(object);
|
||||||
if (monitor.isCanceled()) {
|
if (monitor.isCanceled()) {
|
||||||
|
@ -47,6 +49,7 @@ public class DeferredCWorkbenchAdapter extends CWorkbenchAdapter implements IDef
|
||||||
*
|
*
|
||||||
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
|
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean isContainer() {
|
public boolean isContainer() {
|
||||||
return fCElement instanceof IParent;
|
return fCElement instanceof IParent;
|
||||||
}
|
}
|
||||||
|
@ -56,6 +59,7 @@ public class DeferredCWorkbenchAdapter extends CWorkbenchAdapter implements IDef
|
||||||
*
|
*
|
||||||
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object)
|
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public ISchedulingRule getRule(final Object object) {
|
public ISchedulingRule getRule(final Object object) {
|
||||||
return fCElement.getResource();
|
return fCElement.getResource();
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,6 +232,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.text.IPainter#dispose()
|
* @see org.eclipse.jface.text.IPainter#dispose()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
// no deactivate!
|
// no deactivate!
|
||||||
fIsActive= false;
|
fIsActive= false;
|
||||||
|
@ -256,6 +257,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.text.IPainter#paint(int)
|
* @see org.eclipse.jface.text.IPainter#paint(int)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void paint(int reason) {
|
public void paint(int reason) {
|
||||||
IDocument document= fTextViewer.getDocument();
|
IDocument document= fTextViewer.getDocument();
|
||||||
if (document == null) {
|
if (document == null) {
|
||||||
|
@ -429,6 +431,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.text.IPainter#deactivate(boolean)
|
* @see org.eclipse.jface.text.IPainter#deactivate(boolean)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void deactivate(boolean redraw) {
|
public void deactivate(boolean redraw) {
|
||||||
if (fIsActive) {
|
if (fIsActive) {
|
||||||
fIsActive= false;
|
fIsActive= false;
|
||||||
|
@ -443,6 +446,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.jface.text.IPainter#setPositionManager(org.eclipse.jface.text.IPaintPositionManager)
|
* @see org.eclipse.jface.text.IPainter#setPositionManager(org.eclipse.jface.text.IPaintPositionManager)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPositionManager(IPaintPositionManager manager) {
|
public void setPositionManager(IPaintPositionManager manager) {
|
||||||
fPositionManager= manager;
|
fPositionManager= manager;
|
||||||
}
|
}
|
||||||
|
@ -485,6 +489,7 @@ public class LineBackgroundPainter implements IPainter, LineBackgroundListener {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.swt.custom.LineBackgroundListener#lineGetBackground(org.eclipse.swt.custom.LineBackgroundEvent)
|
* @see org.eclipse.swt.custom.LineBackgroundListener#lineGetBackground(org.eclipse.swt.custom.LineBackgroundEvent)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void lineGetBackground(LineBackgroundEvent event) {
|
public void lineGetBackground(LineBackgroundEvent event) {
|
||||||
if (fTextWidget != null) {
|
if (fTextWidget != null) {
|
||||||
Position match= findIncludingPosition(getDocumentOffset(event.lineOffset));
|
Position match= findIncludingPosition(getDocumentOffset(event.lineOffset));
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class PersistableCElementFactory implements IElementFactory, IPersistable
|
||||||
/**
|
/**
|
||||||
* @see IElementFactory
|
* @see IElementFactory
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IAdaptable createElement(IMemento memento) {
|
public IAdaptable createElement(IMemento memento) {
|
||||||
// Get the file name.
|
// Get the file name.
|
||||||
String fileName = memento.getString(TAG_PATH);
|
String fileName = memento.getString(TAG_PATH);
|
||||||
|
@ -114,6 +115,7 @@ public class PersistableCElementFactory implements IElementFactory, IPersistable
|
||||||
/**
|
/**
|
||||||
* @see IPersistableElement
|
* @see IPersistableElement
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getFactoryId() {
|
public String getFactoryId() {
|
||||||
return FACTORY_ID;
|
return FACTORY_ID;
|
||||||
}
|
}
|
||||||
|
@ -121,6 +123,7 @@ public class PersistableCElementFactory implements IElementFactory, IPersistable
|
||||||
/**
|
/**
|
||||||
* @see IPersistableElement
|
* @see IPersistableElement
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void saveState(IMemento memento) {
|
public void saveState(IMemento memento) {
|
||||||
if (fCElement.getResource() != null) {
|
if (fCElement.getResource() != null) {
|
||||||
memento.putString(TAG_PATH, fCElement.getResource().getFullPath().toString());
|
memento.putString(TAG_PATH, fCElement.getResource().getFullPath().toString());
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class ResourceAdapterFactory implements IAdapterFactory {
|
||||||
/**
|
/**
|
||||||
* @see IAdapterFactory#getAdapterList
|
* @see IAdapterFactory#getAdapterList
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Class<?>[] getAdapterList() {
|
public Class<?>[] getAdapterList() {
|
||||||
return PROPERTIES;
|
return PROPERTIES;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +41,7 @@ public class ResourceAdapterFactory implements IAdapterFactory {
|
||||||
/**
|
/**
|
||||||
* @see IAdapterFactory#getAdapter
|
* @see IAdapterFactory#getAdapter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public Object getAdapter(Object element, Class key) {
|
public Object getAdapter(Object element, Class key) {
|
||||||
if (ICElement.class.equals(key)) {
|
if (ICElement.class.equals(key)) {
|
||||||
|
|
|
@ -35,9 +35,11 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate
|
||||||
|
|
||||||
private ISelection fSelection;
|
private ISelection fSelection;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IAction action) {
|
public void run(IAction action) {
|
||||||
if (!(fSelection instanceof IStructuredSelection))
|
if (!(fSelection instanceof IStructuredSelection))
|
||||||
return;
|
return;
|
||||||
|
@ -71,6 +73,7 @@ public abstract class AbstractUpdateIndexAction implements IObjectActionDelegate
|
||||||
/**
|
/**
|
||||||
* @see IActionDelegate#selectionChanged(IAction, ISelection)
|
* @see IActionDelegate#selectionChanged(IAction, ISelection)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void selectionChanged(IAction action, ISelection selection) {
|
public void selectionChanged(IAction action, ISelection selection) {
|
||||||
fSelection = selection;
|
fSelection = selection;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,20 +11,17 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.actions;
|
package org.eclipse.cdt.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.swt.custom.StyledText;
|
|
||||||
import org.eclipse.swt.graphics.Point;
|
|
||||||
|
|
||||||
import org.eclipse.core.commands.AbstractHandler;
|
import org.eclipse.core.commands.AbstractHandler;
|
||||||
import org.eclipse.core.commands.ExecutionEvent;
|
import org.eclipse.core.commands.ExecutionEvent;
|
||||||
import org.eclipse.core.commands.ExecutionException;
|
import org.eclipse.core.commands.ExecutionException;
|
||||||
import org.eclipse.core.commands.IHandler;
|
import org.eclipse.core.commands.IHandler;
|
||||||
|
|
||||||
import org.eclipse.jface.text.IRegion;
|
import org.eclipse.jface.text.IRegion;
|
||||||
import org.eclipse.jface.text.ITextSelection;
|
import org.eclipse.jface.text.ITextSelection;
|
||||||
import org.eclipse.jface.text.ITextViewerExtension5;
|
import org.eclipse.jface.text.ITextViewerExtension5;
|
||||||
import org.eclipse.jface.text.Region;
|
import org.eclipse.jface.text.Region;
|
||||||
import org.eclipse.jface.text.source.ISourceViewer;
|
import org.eclipse.jface.text.source.ISourceViewer;
|
||||||
|
import org.eclipse.swt.custom.StyledText;
|
||||||
|
import org.eclipse.swt.graphics.Point;
|
||||||
import org.eclipse.ui.actions.QuickMenuCreator;
|
import org.eclipse.ui.actions.QuickMenuCreator;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||||
|
@ -99,6 +96,7 @@ public abstract class CDTQuickMenuCreator extends QuickMenuCreator {
|
||||||
*/
|
*/
|
||||||
public IHandler createHandler() {
|
public IHandler createHandler() {
|
||||||
return new AbstractHandler() {
|
return new AbstractHandler() {
|
||||||
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
createMenu();
|
createMenu();
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Comparator<String> COMP_INSENSITIVE= new Comparator<String> () {
|
private static final Comparator<String> COMP_INSENSITIVE= new Comparator<String> () {
|
||||||
|
@Override
|
||||||
public int compare(String o1, String o2) {
|
public int compare(String o1, String o2) {
|
||||||
return o1.toUpperCase().compareTo(o2.toUpperCase());
|
return o1.toUpperCase().compareTo(o2.toUpperCase());
|
||||||
}
|
}
|
||||||
|
@ -127,14 +128,17 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
||||||
|
|
||||||
private boolean fWroteUnresolvedTitle;
|
private boolean fWroteUnresolvedTitle;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
||||||
fSite= targetPart.getSite();
|
fSite= targetPart.getSite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void selectionChanged(IAction action, ISelection selection) {
|
public void selectionChanged(IAction action, ISelection selection) {
|
||||||
fSelection = selection;
|
fSelection = selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IAction action) {
|
public void run(IAction action) {
|
||||||
if (!(fSelection instanceof IStructuredSelection))
|
if (!(fSelection instanceof IStructuredSelection))
|
||||||
return;
|
return;
|
||||||
|
@ -205,6 +209,7 @@ public class CreateParserLogAction implements IObjectActionDelegate {
|
||||||
CUIPlugin.log(e);
|
CUIPlugin.log(e);
|
||||||
}
|
}
|
||||||
ASTProvider.getASTProvider().runOnAST(tu, ASTProvider.WAIT_IF_OPEN, pm, new ASTCache.ASTRunnable() {
|
ASTProvider.getASTProvider().runOnAST(tu, ASTProvider.WAIT_IF_OPEN, pm, new ASTCache.ASTRunnable() {
|
||||||
|
@Override
|
||||||
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException {
|
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException {
|
||||||
if (ast != null)
|
if (ast != null)
|
||||||
return createLog(out, tu, lang, ast);
|
return createLog(out, tu, lang, ast);
|
||||||
|
|
|
@ -141,6 +141,7 @@ public class DeleteResConfigsHandler extends AbstractHandler {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
openDialog();
|
openDialog();
|
||||||
return null;
|
return null;
|
||||||
|
@ -198,6 +199,7 @@ public class DeleteResConfigsHandler extends AbstractHandler {
|
||||||
|
|
||||||
return new IStructuredContentProvider() {
|
return new IStructuredContentProvider() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object[] getElements(Object inputElement) {
|
public Object[] getElements(Object inputElement) {
|
||||||
if (outData != null) return outData.toArray();
|
if (outData != null) return outData.toArray();
|
||||||
|
|
||||||
|
@ -227,7 +229,9 @@ public class DeleteResConfigsHandler extends AbstractHandler {
|
||||||
}
|
}
|
||||||
return outData.toArray();
|
return outData.toArray();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void dispose() {}
|
public void dispose() {}
|
||||||
|
@Override
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,6 +176,7 @@ public class ExcludeFromBuildHandler extends AbstractHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||||
openDialog();
|
openDialog();
|
||||||
return null;
|
return null;
|
||||||
|
@ -252,8 +253,11 @@ public class ExcludeFromBuildHandler extends AbstractHandler {
|
||||||
|
|
||||||
private IStructuredContentProvider createSelectionDialogContentProvider() {
|
private IStructuredContentProvider createSelectionDialogContentProvider() {
|
||||||
return new IStructuredContentProvider() {
|
return new IStructuredContentProvider() {
|
||||||
|
@Override
|
||||||
public Object[] getElements(Object inputElement) { return cfgNames.toArray(); }
|
public Object[] getElements(Object inputElement) { return cfgNames.toArray(); }
|
||||||
|
@Override
|
||||||
public void dispose() {}
|
public void dispose() {}
|
||||||
|
@Override
|
||||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
|
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class FoldingActionGroup extends ActionGroup {
|
||||||
super(bundle, prefix, IAction.AS_PUSH_BUTTON);
|
super(bundle, prefix, IAction.AS_PUSH_BUTTON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update() {
|
public void update() {
|
||||||
setEnabled(FoldingActionGroup.this.isEnabled() && fViewer.isProjectionMode());
|
setEnabled(FoldingActionGroup.this.isEnabled() && fViewer.isProjectionMode());
|
||||||
}
|
}
|
||||||
|
@ -91,9 +92,11 @@ public class FoldingActionGroup extends ActionGroup {
|
||||||
fViewer= (ProjectionViewer) viewer;
|
fViewer= (ProjectionViewer) viewer;
|
||||||
|
|
||||||
fProjectionListener= new IProjectionListener() {
|
fProjectionListener= new IProjectionListener() {
|
||||||
|
@Override
|
||||||
public void projectionEnabled() {
|
public void projectionEnabled() {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void projectionDisabled() {
|
public void projectionDisabled() {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ public class GotoNextBookmarkAction extends TextEditorAction {
|
||||||
* Private class to handle comparison of markers using their line numbers.
|
* Private class to handle comparison of markers using their line numbers.
|
||||||
*/
|
*/
|
||||||
private class CompareMarker implements Comparator<IMarker> {
|
private class CompareMarker implements Comparator<IMarker> {
|
||||||
|
@Override
|
||||||
public int compare(IMarker m1, IMarker m2) {
|
public int compare(IMarker m1, IMarker m2) {
|
||||||
int l1 = MarkerUtilities.getLineNumber(m1);
|
int l1 = MarkerUtilities.getLineNumber(m1);
|
||||||
int l2 = MarkerUtilities.getLineNumber(m2);
|
int l2 = MarkerUtilities.getLineNumber(m2);
|
||||||
|
|
|
@ -117,6 +117,7 @@ public class IndentAction extends TextEditorAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
Runnable runnable= new Runnable() {
|
Runnable runnable= new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
IRewriteTarget target= (IRewriteTarget)getTextEditor().getAdapter(IRewriteTarget.class);
|
IRewriteTarget target= (IRewriteTarget)getTextEditor().getAdapter(IRewriteTarget.class);
|
||||||
if (target != null)
|
if (target != null)
|
||||||
|
|
|
@ -27,9 +27,11 @@ public class RebuildIndexAction implements IObjectActionDelegate {
|
||||||
|
|
||||||
private ISelection fSelection;
|
private ISelection fSelection;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IAction action) {
|
public void run(IAction action) {
|
||||||
IStructuredSelection cElements= SelectionConverter.convertSelectionToCElements(fSelection);
|
IStructuredSelection cElements= SelectionConverter.convertSelectionToCElements(fSelection);
|
||||||
for (Iterator<?> i = cElements.iterator(); i.hasNext();) {
|
for (Iterator<?> i = cElements.iterator(); i.hasNext();) {
|
||||||
|
@ -43,6 +45,7 @@ public class RebuildIndexAction implements IObjectActionDelegate {
|
||||||
/**
|
/**
|
||||||
* @see IActionDelegate#selectionChanged(IAction, ISelection)
|
* @see IActionDelegate#selectionChanged(IAction, ISelection)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void selectionChanged(IAction action, ISelection selection) {
|
public void selectionChanged(IAction action, ISelection selection) {
|
||||||
fSelection= selection;
|
fSelection= selection;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,11 @@ import org.eclipse.jface.action.Action;
|
||||||
import org.eclipse.jface.action.IMenuListener;
|
import org.eclipse.jface.action.IMenuListener;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.jface.action.MenuManager;
|
import org.eclipse.jface.action.MenuManager;
|
||||||
|
import org.eclipse.jface.text.ITextSelection;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||||
import org.eclipse.jface.text.ITextSelection;
|
|
||||||
import org.eclipse.ui.actions.ActionGroup;
|
import org.eclipse.ui.actions.ActionGroup;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||||
|
|
||||||
public class SurroundWithActionGroup extends ActionGroup {
|
public class SurroundWithActionGroup extends ActionGroup {
|
||||||
|
@ -56,6 +57,7 @@ public class SurroundWithActionGroup extends ActionGroup {
|
||||||
menu.appendToGroup(fGroup, subMenu);
|
menu.appendToGroup(fGroup, subMenu);
|
||||||
subMenu.add(new Action() {});
|
subMenu.add(new Action() {});
|
||||||
subMenu.addMenuListener(new IMenuListener() {
|
subMenu.addMenuListener(new IMenuListener() {
|
||||||
|
@Override
|
||||||
public void menuAboutToShow(IMenuManager manager) {
|
public void menuAboutToShow(IMenuManager manager) {
|
||||||
manager.removeAll();
|
manager.removeAll();
|
||||||
SurroundWithTemplateMenuAction.fillMenu(manager, fEditor);
|
SurroundWithTemplateMenuAction.fillMenu(manager, fEditor);
|
||||||
|
|
|
@ -15,24 +15,12 @@ import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.swt.events.MenuAdapter;
|
|
||||||
import org.eclipse.swt.events.MenuEvent;
|
|
||||||
import org.eclipse.swt.graphics.Point;
|
|
||||||
import org.eclipse.swt.widgets.Control;
|
|
||||||
import org.eclipse.swt.widgets.Menu;
|
|
||||||
import org.eclipse.swt.widgets.MenuItem;
|
|
||||||
import org.eclipse.swt.widgets.Shell;
|
|
||||||
|
|
||||||
import org.eclipse.core.runtime.Assert;
|
import org.eclipse.core.runtime.Assert;
|
||||||
|
|
||||||
import org.eclipse.jface.action.Action;
|
import org.eclipse.jface.action.Action;
|
||||||
import org.eclipse.jface.action.ActionContributionItem;
|
import org.eclipse.jface.action.ActionContributionItem;
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.jface.action.Separator;
|
import org.eclipse.jface.action.Separator;
|
||||||
import org.eclipse.jface.viewers.ISelection;
|
|
||||||
import org.eclipse.jface.viewers.ISelectionProvider;
|
|
||||||
|
|
||||||
import org.eclipse.jface.text.DocumentEvent;
|
import org.eclipse.jface.text.DocumentEvent;
|
||||||
import org.eclipse.jface.text.IDocument;
|
import org.eclipse.jface.text.IDocument;
|
||||||
import org.eclipse.jface.text.IEditingSupport;
|
import org.eclipse.jface.text.IEditingSupport;
|
||||||
|
@ -44,7 +32,15 @@ import org.eclipse.jface.text.ITextViewer;
|
||||||
import org.eclipse.jface.text.ITextViewerExtension;
|
import org.eclipse.jface.text.ITextViewerExtension;
|
||||||
import org.eclipse.jface.text.contentassist.ICompletionProposal;
|
import org.eclipse.jface.text.contentassist.ICompletionProposal;
|
||||||
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
|
import org.eclipse.jface.text.contentassist.ICompletionProposalExtension2;
|
||||||
|
import org.eclipse.jface.viewers.ISelection;
|
||||||
|
import org.eclipse.jface.viewers.ISelectionProvider;
|
||||||
|
import org.eclipse.swt.events.MenuAdapter;
|
||||||
|
import org.eclipse.swt.events.MenuEvent;
|
||||||
|
import org.eclipse.swt.graphics.Point;
|
||||||
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Menu;
|
||||||
|
import org.eclipse.swt.widgets.MenuItem;
|
||||||
|
import org.eclipse.swt.widgets.Shell;
|
||||||
import org.eclipse.ui.IPartListener;
|
import org.eclipse.ui.IPartListener;
|
||||||
import org.eclipse.ui.IPartService;
|
import org.eclipse.ui.IPartService;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
|
@ -55,6 +51,7 @@ import org.eclipse.ui.dialogs.PreferencesUtil;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
import org.eclipse.cdt.internal.ui.editor.CEditor;
|
||||||
import org.eclipse.cdt.internal.ui.text.contentassist.CContentAssistInvocationContext;
|
import org.eclipse.cdt.internal.ui.text.contentassist.CContentAssistInvocationContext;
|
||||||
import org.eclipse.cdt.internal.ui.text.contentassist.TemplateCompletionProposalComputer;
|
import org.eclipse.cdt.internal.ui.text.contentassist.TemplateCompletionProposalComputer;
|
||||||
|
@ -103,19 +100,24 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
private IPartService fPartService;
|
private IPartService fPartService;
|
||||||
private IPartListener fPartListener= new IPartListener() {
|
private IPartListener fPartListener= new IPartListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public void partActivated(IWorkbenchPart part) {
|
public void partActivated(IWorkbenchPart part) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void partBroughtToTop(IWorkbenchPart part) {
|
public void partBroughtToTop(IWorkbenchPart part) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void partClosed(IWorkbenchPart part) {
|
public void partClosed(IWorkbenchPart part) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void partDeactivated(IWorkbenchPart part) {
|
public void partDeactivated(IWorkbenchPart part) {
|
||||||
disposeMenuItems();
|
disposeMenuItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void partOpened(IWorkbenchPart part) {
|
public void partOpened(IWorkbenchPart part) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -136,6 +138,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Menu getMenu(Menu parent) {
|
public Menu getMenu(Menu parent) {
|
||||||
setMenu(new Menu(parent));
|
setMenu(new Menu(parent));
|
||||||
fillMenu(fMenu);
|
fillMenu(fMenu);
|
||||||
|
@ -146,6 +149,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Menu getMenu(Control parent) {
|
public Menu getMenu(Control parent) {
|
||||||
setMenu(new Menu(parent));
|
setMenu(new Menu(parent));
|
||||||
fillMenu(fMenu);
|
fillMenu(fMenu);
|
||||||
|
@ -170,6 +174,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
if (fPartService != null) {
|
if (fPartService != null) {
|
||||||
fPartService.removePartListener(fPartListener);
|
fPartService.removePartListener(fPartListener);
|
||||||
|
@ -181,6 +186,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init(IWorkbenchWindow window) {
|
public void init(IWorkbenchWindow window) {
|
||||||
if (fPartService != null) {
|
if (fPartService != null) {
|
||||||
fPartService.removePartListener(fPartListener);
|
fPartService.removePartListener(fPartListener);
|
||||||
|
@ -199,6 +205,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void run(IAction action) {
|
public void run(IAction action) {
|
||||||
IWorkbenchPart activePart= CUIPlugin.getActivePage().getActivePart();
|
IWorkbenchPart activePart= CUIPlugin.getActivePage().getActivePart();
|
||||||
if (!(activePart instanceof CEditor))
|
if (!(activePart instanceof CEditor))
|
||||||
|
@ -217,6 +224,7 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void selectionChanged(IAction action, ISelection selection) {
|
public void selectionChanged(IAction action, ISelection selection) {
|
||||||
// Default do nothing
|
// Default do nothing
|
||||||
}
|
}
|
||||||
|
@ -344,10 +352,12 @@ public class SurroundWithTemplateMenuAction implements IWorkbenchWindowPulldownD
|
||||||
IEditingSupportRegistry registry= null;
|
IEditingSupportRegistry registry= null;
|
||||||
IEditingSupport helper= new IEditingSupport() {
|
IEditingSupport helper= new IEditingSupport() {
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isOriginator(DocumentEvent event, IRegion focus) {
|
public boolean isOriginator(DocumentEvent event, IRegion focus) {
|
||||||
return focus.getOffset() <= offset && focus.getOffset() + focus.getLength() >= offset;
|
return focus.getOffset() <= offset && focus.getOffset() + focus.getLength() >= offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean ownsFocusShell() {
|
public boolean ownsFocusShell() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,6 @@ package org.eclipse.cdt.internal.ui.actions;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.CoreModel;
|
|
||||||
import org.eclipse.cdt.internal.ui.CUIStatus;
|
|
||||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -23,10 +21,13 @@ import org.eclipse.core.runtime.OperationCanceledException;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
|
|
||||||
import org.eclipse.jface.operation.IRunnableWithProgress;
|
import org.eclipse.jface.operation.IRunnableWithProgress;
|
||||||
import org.eclipse.jface.operation.IThreadListener;
|
import org.eclipse.jface.operation.IThreadListener;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.model.CoreModel;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.internal.ui.CUIStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An <code>IRunnableWithProgress</code> that adapts and <code>IWorkspaceRunnable</code>
|
* An <code>IRunnableWithProgress</code> that adapts and <code>IWorkspaceRunnable</code>
|
||||||
* so that is can be executed inside <code>IRunnableContext</code>. <code>OperationCanceledException</code>
|
* so that is can be executed inside <code>IRunnableContext</code>. <code>OperationCanceledException</code>
|
||||||
|
@ -71,6 +72,7 @@ public class WorkbenchRunnableAdapter implements IRunnableWithProgress, IThreadL
|
||||||
return fRule;
|
return fRule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void threadChange(Thread thread) {
|
public void threadChange(Thread thread) {
|
||||||
if (fTransfer)
|
if (fTransfer)
|
||||||
Job.getJobManager().transferRule(fRule, thread);
|
Job.getJobManager().transferRule(fRule, thread);
|
||||||
|
@ -79,6 +81,7 @@ public class WorkbenchRunnableAdapter implements IRunnableWithProgress, IThreadL
|
||||||
/*
|
/*
|
||||||
* @see IRunnableWithProgress#run(IProgressMonitor)
|
* @see IRunnableWithProgress#run(IProgressMonitor)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
|
||||||
try {
|
try {
|
||||||
CoreModel.run(fWorkspaceRunnable, fRule, monitor);
|
CoreModel.run(fWorkspaceRunnable, fRule, monitor);
|
||||||
|
|
Loading…
Add table
Reference in a new issue