Changeset 3858 for devel-tools


Ignore:
Timestamp:
Jul 21, 2008, 7:09:46 PM (12 years ago)
Author:
orlov
Message:
  • Open declaration in one file.
Location:
devel-tools/trunk/eclipse/org.refal.rfpdt.ui
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/plugin.xml

    r3817 r3858  
    8383            sequence="Ctrl+Shift+F"/>
    8484      <key
    85             commandId="org.refal.rfpdt.editor.goto.matching.bracket"
     85            commandId="org.refal.rfpdt.editor.commands.gotoMatchingBracket"
    8686            contextId="org.refal.rfpdt.editor.rfpEditorScope"
    8787            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
    8888            sequence="M1+M2+P"/>
     89      <key
     90            commandId="org.refal.rfpdt.editor.commands.openDeclaration"
     91            contextId="org.refal.rfpdt.editor.rfpEditorScope"
     92            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
     93            sequence="F3"/>
    8994   </extension>
    9095   <extension
     
    125130            categoryId="org.refal.rfpdt.editor.commands"
    126131            description="Moves the cursor to the matching bracket"
    127             id="org.refal.rfpdt.editor.goto.matching.bracket"
     132            id="org.refal.rfpdt.editor.commands.gotoMatchingBracket"
    128133            name="Go to Matching Bracket"/>
     134      <command
     135            categoryId="org.refal.rfpdt.editor.commands"
     136            description="Open declaration"
     137            id="org.refal.rfpdt.editor.commands.openDeclaration"
     138            name="Open Declaration"/>
    129139   </extension>
    130140   <extension
     
    179189               label="&amp;Format"
    180190               menubarPath="org.refal.rfpdt.editor.rfpEditorSourceMenu/content"/>
     191         <action
     192               class="org.refal.rfpdt.ui.actions.OpenDeclarationAction"
     193               definitionId="org.refal.rfpdt.editor.commands.openDeclaration"
     194               id="org.refal.rfpdt.editor.openDeclaration"
     195               label="&amp;Open Declaration"
     196               menubarPath="navigate/open.ext"/>
    181197         <action
    182198               label="Not used"
     
    263279               label="Correct &amp;Indentation"
    264280               menubarPath="group.edit"/>
     281         <action
     282               class="org.refal.rfpdt.ui.actions.OpenDeclarationAction"
     283               definitionId="org.refal.rfpdt.editor.commands.openDeclaration"
     284               id="org.refal.rfpdt.editor.editorContextMenu.openDeclaration"
     285               label="&amp;Open Declaration"
     286               menubarPath="group.open"/>
    265287      </viewerContribution>
    266288      <viewerContribution
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditor.java

    r3801 r3858  
    22
    33import java.util.ArrayList;
     4import java.util.List;
    45
    56import org.eclipse.core.resources.IProject;
     
    347348        setStatusLineErrorMessage(str);
    348349    }
     350   
     351    public List<AstNode> getNodes (int offset) {
     352        if (rfpReconcilingStrategy == null)
     353            return null;
     354        AstImplem astImplem = rfpReconcilingStrategy.getAstImplem();
     355        if (astImplem == null)
     356            return null;
     357        return Searcher.search(astImplem, offset);
     358    }
    349359}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditorMessages.java

    r3508 r3858  
    2626    public static String GotoMatchingBracket_error_noMatchingBracket;
    2727    public static String GotoMatchingBracket_error_bracketOutsideSelectedElement;
     28   
     29    public static String OpenDeclaration_label;
     30    public static String OpenDeclaration_error_invalidSelection;
    2831}
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpEditorMessages.properties

    r3508 r3858  
    33GotoMatchingBracket_error_noMatchingBracket = No matching bracket found
    44GotoMatchingBracket_error_bracketOutsideSelectedElement = Matching bracket is outside the selected element
     5
     6OpenDeclaration_label = &Open Declaration
     7OpenDeclaration_error_invalidSelection = Current selection doesn't resolve to Refal element
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/editor/RfpTextHover.java

    r3566 r3858  
    11package org.refal.rfpdt.editor;
    22
    3 import java.util.ArrayList;
     3import java.util.List;
    44
    55import org.eclipse.jface.text.DefaultTextHover;
     
    99import org.eclipse.jface.text.source.ISourceViewer;
    1010import org.eclipse.ui.texteditor.MarkerAnnotation;
    11 import org.refal.rfpdt.ast.AstImplem;
    1211import org.refal.rfpdt.ast.AstName;
    1312import org.refal.rfpdt.ast.AstNode;
    1413import org.refal.rfpdt.ast.IHoverInfo;
    15 import org.refal.rfpdt.ast.Searcher;
    1614
    1715public class RfpTextHover extends DefaultTextHover {
     
    2725        if (res != null)
    2826            return res;
    29         if (editor.rfpReconcilingStrategy == null)
     27        List<AstNode> astNodeList = editor.getNodes(hoverRegion.getOffset());
     28        if (astNodeList == null)
    3029            return null;
    31         AstImplem astImplem = editor.rfpReconcilingStrategy.getAstImplem();
    32         if (astImplem == null)
    33             return null;
    34         ArrayList<AstNode> astNodeList = Searcher.search(astImplem, hoverRegion.getOffset());
    3530        int size = astNodeList.size();
    3631        if (size > 1 && astNodeList.get(size-1) instanceof AstName && astNodeList.get(size-2) instanceof IHoverInfo)
  • devel-tools/trunk/eclipse/org.refal.rfpdt.ui/src/org/refal/rfpdt/ui/actions/IRfpEditorActionDefinitionIds.java

    r3508 r3858  
    44
    55public interface IRfpEditorActionDefinitionIds extends ITextEditorActionDefinitionIds {
    6 
    76    /**
    87     * Action definition ID of the edit -> go to matching bracket action
    98     * (value <code>"org.refal.rfpdt.editor.goto.matching.bracket"</code>).
    109     */
    11     public static final String GOTO_MATCHING_BRACKET = "org.refal.rfpdt.editor.goto.matching.bracket"; //$NON-NLS-1$
    12 
     10    public static final String GOTO_MATCHING_BRACKET = "org.refal.rfpdt.editor.commands.gotoMatchingBracket"; //$NON-NLS-1$
    1311}
Note: See TracChangeset for help on using the changeset viewer.