Changeset 3862 for devel-tools


Ignore:
Timestamp:
Jul 23, 2008, 12:22:09 PM (12 years ago)
Author:
yura
Message:
  • Refactoring
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/IndentAction.java

    r3859 r3862  
    4040                    if (target != null)
    4141                        target.beginCompoundChange();
    42 
    4342                    try {
    4443                        for (int line = firstLine; line < firstLine + nLines; line++) {
     
    6362                        // will only happen on concurrent modification
    6463                        RfpUI.log("ConcurrentModification in IndentAction", e); //$NON-NLS-1$
    65 
    6664                    } finally {
    6765                        if (target != null)
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/OpenDeclarationAction.java

    r3860 r3862  
    2121
    2222public class OpenDeclarationAction extends RfpEditorActionDelegate {
    23     public static final String OPEN_DECLARATION = "openDeclaration"; //$NON-NLS-1$
    24 
    2523    public void run () {
    2624        if (editor == null)
     
    8482        return null;
    8583    }
    86 
    8784}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/RetargettableActionAdapterFactory.java

    r3508 r3862  
    1111 */
    1212public class RetargettableActionAdapterFactory implements IAdapterFactory {
    13     /*
    14      * (non-Javadoc)
    15      *
    16      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
    17      */
    1813    @SuppressWarnings("unchecked")
    1914    public Object getAdapter (Object adaptableObject, Class adapterType) {
    20         if (adapterType == IToggleBreakpointsTarget.class) {
     15        if (adapterType == IToggleBreakpointsTarget.class)
    2116            return new ToggleBreakpointAdapter();
    22         }
    2317        return null;
    2418    }
    2519
    26     /*
    27      * (non-Javadoc)
    28      *
    29      * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
    30      */
    3120    @SuppressWarnings("unchecked")
    3221    public Class[] getAdapterList () {
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/RfpEditorActionDelegate.java

    r3859 r3862  
    1818
    1919    public void run (IAction action) {
    20         this.run();
     20        run();
    2121    }
    2222
     
    3939
    4040    /**
    41      * Returns the editor's selection provider.
    42      *
    43      * @return the editor's selection provider or <code>null</code>
    44      */
    45     protected ISelectionProvider getSelectionProvider () {
    46         if (editor != null)
    47             return editor.getSelectionProvider();
    48         return null;
    49     }
    50 
    51     /**
    5241     * Returns the selection on the editor or an invalid selection if none can be obtained. Returns never
    5342     * <code>null</code>.
     
    5645     */
    5746    protected ITextSelection getSelection () {
    58         ISelectionProvider provider = getSelectionProvider();
    59         if (provider != null) {
    60             ISelection selection = provider.getSelection();
    61             if (selection instanceof ITextSelection)
    62                 return (ITextSelection) selection;
     47        if (editor != null) {
     48            ISelectionProvider provider = editor.getSelectionProvider();
     49            if (provider != null) {
     50                ISelection selection = provider.getSelection();
     51                if (selection instanceof ITextSelection)
     52                    return (ITextSelection) selection;
     53            }
    6354        }
    6455        return TextSelection.emptySelection();
     
    6657
    6758    public void setActiveEditor (IAction action, IEditorPart editor) {
    68         if (editor instanceof RfpEditor)
    69             this.editor = (RfpEditor) editor;
    70         else
    71             this.editor = null;
     59        this.editor = editor instanceof RfpEditor ? (RfpEditor) editor : null;
    7260    }
    7361
Note: See TracChangeset for help on using the changeset viewer.