com.ibm.rational.common.test.editor.framework

Class TestEditor

    • Field Detail

      • VIEW_MODE_NORMAL

        public static final byte VIEW_MODE_NORMAL
      • LASTSELECTION

        public static final String LASTSELECTION
      • LASTFIELDSELECTION

        protected static final String LASTFIELDSELECTION
    • Constructor Detail

      • TestEditor

        protected TestEditor(Class<? extends org.eclipse.emf.ecore.EObject> editorObjectClass)
        TestEditor create an instance of this object from your EditorExtension.createPages method.
        Parameters:
        ext - EditorExtension
    • Method Detail

      • setInput

        protected void setInput(IEditorInput input)
        Overrides:
        setInput in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • dispose

        public void dispose()
        Specified by:
        dispose in interface IWorkbenchPart
        Overrides:
        dispose in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • setEditorObject

        protected void setEditorObject(org.eclipse.emf.ecore.EObject editorObject)
        Overrides:
        setEditorObject in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • canAddModelElement

        public boolean canAddModelElement(String elementType)
      • createTestObject

        protected abstract CBTest createTestObject(org.eclipse.hyades.models.common.facades.behavioral.ITestSuite testSuite)
        Loads and returns concrete type derived from CBTest.
        Returns:
        CBTest
      • formatMessage

        protected String formatMessage(com.ibm.rational.test.common.models.behavior.exceptions.CommonModelException e1)
      • getApplicableTypes

        public String[] getApplicableTypes()
        Used by base editor's ExtensionContainers to filter extensions. You will want to override this method to limit what extensions can contribute to your editor.

        Default implementation returns String [] {"*"} which will load all extensions.

        Returns:
        array of types that this editor is going to support. Base editor class will filter out all extensions that do NOT list any of these types as supported in their <forTypes>
      • createMainFormContent

        protected void createMainFormContent(IManagedForm managedForm)
        Specified by:
        createMainFormContent in class com.ibm.rational.common.test.editor.framework.editor.RptEditor
      • updateEditorWindowTitle

        public void updateEditorWindowTitle()
        Updates editor's window title with information obtained from loaded test resource.
      • saveFile

        public void saveFile(IProgressMonitor monitor)
                      throws Exception
        Specified by:
        saveFile in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
        Throws:
        Exception
      • postSave

        protected void postSave(IFile newFile)
        Overrides:
        postSave in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • saveFileTo

        protected void saveFileTo(IFile file,
                      IProgressMonitor monitor)
                           throws Exception
        Specified by:
        saveFileTo in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
        Throws:
        Exception
      • doSaveAs

        public void doSaveAs()
        Specified by:
        doSaveAs in interface ISaveablePart
        Overrides:
        doSaveAs in class com.ibm.rational.common.test.editor.framework.editor.RptEditor
      • performSaveAsRPT

        protected boolean performSaveAsRPT(IProgressMonitor progressMonitor)
      • onSaveAsComplete

        protected void onSaveAsComplete(IFile file,
                            String newID,
                            String newName)
      • isSaveAsAllowed

        public boolean isSaveAsAllowed()
        Specified by:
        isSaveAsAllowed in interface ISaveablePart
        Overrides:
        isSaveAsAllowed in class com.ibm.rational.common.test.editor.framework.editor.RptEditor
      • saveState

        public void saveState()
        Saves editor state
      • reload

        public void reload()
        Overrides:
        reload in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • refreshContent

        protected void refreshContent(Object o)
        Specified by:
        refreshContent in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • connectToEclipse

        protected void connectToEclipse(IEditorPart part)
        Parameters:
        site -
      • createTreeContentProvider

        protected com.ibm.rational.common.test.editor.framework.kernel.interfaces.IContentProvider createTreeContentProvider()
      • getContentProvider

        public com.ibm.rational.common.test.editor.framework.kernel.interfaces.IContentProvider getContentProvider()
        Specified by:
        getContentProvider in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • getLabelProvider

        public ILabelProvider getLabelProvider()
        Specified by:
        getLabelProvider in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • createLabelProvider

        public ILabelProvider createLabelProvider()
        Specified by:
        createLabelProvider in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • createEditorForm

        protected com.ibm.rational.common.test.editor.framework.TestEditorForm createEditorForm()
        Creates the TestEditorForm. This method can be overridden to return a sub-class instance.
        Returns:
        TestEditorForm - the editor form
      • getTestSuite

        public org.eclipse.hyades.models.common.facades.behavioral.ITestSuite getTestSuite()
        Returns:
        ITestSuite
      • markDirty

        public void markDirty()
        Marks the TestEditor as dirty. Dirty editors can be saved.
        Overrides:
        markDirty in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
        See Also:
        org.eclipse.hyades.test.ui.internal.editor.extension.BaseEditorExtension#markDirty()
      • cancelCutOperation

        public void cancelCutOperation()
        Convenience method for cancelling active Cut operation. Cut operation affects the way Test contents are represented. Calling this method will restore presentation to Normal mode and cancel CutOperation (if one is active).

        This method is called when any model element gets modified, or the model itself is modified by adding, removing, or rearranging model elements.

      • clearDirty

        public void clearDirty()
        Clears editor's dirty state.
        Overrides:
        clearDirty in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
        See Also:
        org.eclipse.hyades.test.ui.internal.editor.extension.BaseEditorExtension#clearDirty()
      • getEditorName

        public final String getEditorName()
        Returns editor name.
        Specified by:
        getEditorName in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
        Returns:
        String editor name.
      • getDialogCaption

        public String getDialogCaption(String dialogName)
        Specified by:
        getDialogCaption in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • computeEditorName

        protected abstract String computeEditorName()
      • computeFormTitle

        protected abstract String computeFormTitle()
      • computeLeftTreeTitle

        protected abstract String computeLeftTreeTitle()
      • computeLeftTreeDescription

        protected abstract String computeLeftTreeDescription()
      • computeRightTreeTitle

        protected abstract String computeRightTreeTitle()
      • computeRightTreeDescription

        protected abstract String computeRightTreeDescription()
      • getForm

        public com.ibm.rational.common.test.editor.framework.TestEditorForm getForm()
        Returns editor form.

        From TestEditorForm you can access EditorSections.

        Returns:
        TestEditorForm editorForm.
      • unload

        protected void unload(boolean reserved)
        This method is called when TestEditor is being unloaded.
        Parameters:
        reserved -
      • getSecondarySelection

        public ISelection getSecondarySelection()
        Returns the current selection in the right-panel of the editor.
        Returns:
      • getCurrentSelection

        public IStructuredSelection getCurrentSelection()
        Returns current selection.

        Current selection is what is currently selected in the TestEditor Main (tree) section.

        NOTE this method, as well as the handling of "current selection" is subject to change in the future versions if RPT Test Editor.

        Returns:
        IStructuredSelection
      • getTest

        public CBTest getTest()
        Returns CBTest. CBTest is base class for concreate test types, and is a root element in the TestEditor's Tree section.
        Specified by:
        getTest in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
        Returns:
        CBTEst
      • setCbTest

        protected void setCbTest(CBTest test)
        Parameters:
        test -
      • setInput

        public void setInput(Object arg0)
        This method is called when the test is opening in the Eclipse editor. Clients must not call it directly.
        Parameters:
        arg0 -
      • displayObject

        public void displayObject(com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITargetDescriptor target)
        Directs TestEditor to locate and select specified model element in the tree section. Optionally, ITargetDescriptor may contain additional, more precise, information about attribute and position within attribute of the target model element.

        NOTE this mechanism is subject to chage in the future versions of TestEditor.

        Parameters:
        target - ITargetDescriptor
        See Also:
        ITargetDescriptor, ExtLayoutProvider.navigateTo(ITargetDescriptor)
      • displayMatch

        public void displayMatch(Object match)
        Displays Search Match. This implementation is a placeholder and does nothing.
        Parameters:
        match - Object
      • setStatusLineMessage

        public void setStatusLineMessage(String string,
                                boolean isError,
                                Image image)
        Sets status line text and image. IStautsLineManager is obtained by a call to:
         IStatusLineManager slm = getCallingEditorExtension().getHyadesEditorPart().getEditorPart().getEditorSite().getActionBars().getStatusLineManager();
         
        Parameters:
        string - String text for statusline.
        isError - boolean
        image - Image or null
      • setStatusLineMessage

        public void setStatusLineMessage(String string,
                                boolean isError)
        Sets status line text. IStautsLineManager is obtained by a call to:
         IStatusLineManager slm = getCallingEditorExtension().getHyadesEditorPart().getEditorPart().getEditorSite().getActionBars().getStatusLineManager();
         
        Parameters:
        string - String text for statusline.
        isError - boolean
      • markLocation

        public void markLocation()
      • storeFieldLocation

        public void storeFieldLocation(com.ibm.rational.common.test.editor.framework.extensions.TextAttributeField field,
                              int selStart,
                              int selEnd)
      • registerEditActionsHandler

        public void registerEditActionsHandler(com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITextGlobalActionHandler handler,
                                      Control control,
                                      ISelectionProvider selectionProvider)
      • unregisterEditActionsHandler

        public void unregisterEditActionsHandler(Control control)
      • unregisterEditActionsHandler

        public void unregisterEditActionsHandler(com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITextGlobalActionHandler handler)
      • restoreState

        protected void restoreState()
        Restores editor state upon load. Clients should not call this method directly.
      • setViewMode

        protected void setViewMode(byte lastViewMode,
                       StructuredSelection ssel)
        This implementation does nothing.
        Parameters:
        lastViewMode - byte. Editor mode.
        ssel - Selection of objects to display innew mode.
      • doFirstTimeInit

        protected void doFirstTimeInit()
      • setReadOnly

        public void setReadOnly(boolean isReadOnly)
        Changes editor state as read-only. This method is called from CommonEditorExtension and should not be called b clients directly.
        Parameters:
        isReadOnly -
      • isReadOnly

        public boolean isReadOnly()
        Overrides:
        isReadOnly in class com.ibm.rational.common.test.editor.framework.editor.RptEditor
        Returns:
        boolean true if the editor is read-only and cannot be saved, false otherwise.
      • refresh

        public void refresh()
        Refreshes details section of the element(s) currently selected in the editor tree.
      • refreshActionStates

        public void refreshActionStates()
        Refresh the state of the actions associated to the current selection. This method should be called whenever the selection is not changed, but the state of the actions associated to the selected may have changed.
      • jobCreated

        public void jobCreated(com.ibm.rational.common.test.editor.framework.jobs.TestModifyingJob job)
        Parameters:
        job -
      • hasJobs

        public int hasJobs()
      • getExtensionContext

        public com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext getExtensionContext(String elementType)
        Specified by:
        getExtensionContext in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • getExtensionContext

        public com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext getExtensionContext(CBActionElement element)
        Specified by:
        getExtensionContext in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • getProviders

        public com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext getProviders(String type)
        Returns ITestEditorExtensionContext (providers container) for the specified type.
        Parameters:
        type - String CBActionElement type.
        Returns:
        ITestEditorExtensionContext providers.
      • getProviders

        public com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext getProviders(String type,
                                                                                                               boolean required)
        Returns ITestEditorExtensionContext (providers container) for the specified type.
        Parameters:
        type - String CBActionElement type.
        required - If true, asks this method to throw an exception if the provider does not exist. If false, let this method return null if the provider does not exist.
        Returns:
        ITestEditorExtensionContext providers.
      • getProviders

        public com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext getProviders(CBActionElement element)
        Returns ITestEditorExtensionContext (providers container) for the specified CBActionElement.
        Parameters:
        element - CBActionElement.
        Returns:
        ITestEditorExtensionContext providers.
      • getProviders

        public List<com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext> getProviders(IStructuredSelection selection)
        Returns ITestEditorExtensionContexts (one or more providers) for CBActionElements contained in the specified StructuredSelection. One provider is returned for multiple CBActionElements of the same type.
        Parameters:
        selection - IStructuredSelection as obtained from tree section's TreeViewer.
        Returns:
        ITestEditorExtensionContext providers.
      • getProviders

        public List<com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditorExtensionContext> getProviders(Collection<CBActionElement> elements)
        Returns ITestEditorExtensionContexts (one or more providers) for CBActionElements contained in the specified StructuredSelection. One provider is returned for multiple CBActionElements of the same type.
        Parameters:
        selection - IStructuredSelection as obtained from tree section's TreeViewer.
        Returns:
        ITestEditorExtensionContext providers.
      • fillContextMenu

        public void fillContextMenu(IMenuManager menu)
        Fills content menu for TestEditor's MainSection
        Parameters:
        menu - IMenuManager
      • getBookmarkAction

        public com.ibm.rational.common.test.editor.framework.kernel.actions.CreateBookmarkAction getBookmarkAction()
      • getAdapter

        public Object getAdapter(Class adapter)
        Specified by:
        getAdapter in interface IAdaptable
        Overrides:
        getAdapter in class com.ibm.rational.common.test.editor.framework.editor.RptEditor
      • activate

        public void activate(boolean active)
      • isOkToSave

        public boolean isOkToSave()
        Overrides:
        isOkToSave in class com.ibm.rational.common.test.editor.framework.editor.RptEmfEditor
      • fixBadRequirements

        protected void fixBadRequirements()
        Find and disable requirement targets with all incomplete requirements
      • getFormattedResourceName

        public String getFormattedResourceName()
      • updateFindRepleceAction

        public void updateFindRepleceAction()
      • getFindReplaceAction

        public final FindReplaceAction getFindReplaceAction()
        Returns:
        the findReplaceAction
      • getTestSearchQuery

        public ISearchQuery getTestSearchQuery(com.ibm.rational.common.test.editor.framework.kernel.search.QuerySpecification specs,
                                      int what)
        Returns instanceof SearchQuery. Extensing classes may override and return null if no search is supported, or some more specialized query. When this method is called from SearchPage, the second argument is QuerySpecification.QUERY_TYPE_DEFALT.
        Parameters:
        specs - QuerySpecification query specification
        int - what An application defined flag telling the method what query to return or QuerySpecification.QUERY_TYPE_DEFALT
        Returns:
        ISearchQuery
      • getEnableDisableActionGroup

        public com.ibm.rational.common.test.editor.framework.kernel.actions.EnableDisableActionGroup getEnableDisableActionGroup()
      • getLabelFor

        public String getLabelFor(Object element)
        Parameters:
        element -
        Returns:
        String
      • getImageFor

        public Image getImageFor(Object element)
        Parameters:
        element -
        Returns:
        Image
      • getAvailableTypes

        public final Set<String> getAvailableTypes()
        Returns:
        the availableTypes
      • addAvailableType

        public void addAvailableType(String type)
      • getViewMode

        public byte getViewMode()
      • getRegexSearchValue

        public boolean getRegexSearchValue()
      • getCaseSearchValue

        public boolean getCaseSearchValue()
      • setCaseSearchValue

        public void setCaseSearchValue(boolean selection)
      • setRegexSearchValue

        public void setRegexSearchValue(boolean selection)
      • getRecentSearches

        public List<String> getRecentSearches()
      • addRecentSearchText

        public void addRecentSearchText(String text)
      • isHighlightSearchResults

        public boolean isHighlightSearchResults()
      • setHighlightSearchResults

        public void setHighlightSearchResults(boolean b)
      • createExceptionsUI

        public abstract com.ibm.rational.common.test.editor.framework.extensions.ExceptionsUI createExceptionsUI(ExtLayoutProvider provider)
      • showInsertionPoint

        public void showInsertionPoint(Object parent,
                              int index)
      • hideInsertionPoint

        public void hideInsertionPoint()
      • isAcceptingPasteFrom

        public boolean isAcceptingPasteFrom(TestEditor editor)
        Returns whether this test editor supports pasting elements copied from the specified editor. The default implementation returns true only if the other editor has the same type as this editor.
        Parameters:
        editor - Another test editor
        Returns:
      • getChangeFactory

        public com.ibm.rational.common.test.editor.framework.change.ITestEditorChangeFactory getChangeFactory()
        Specified by:
        getChangeFactory in interface com.ibm.rational.common.test.editor.framework.kernel.interfaces.ITestEditor
      • getOperationService

        public com.ibm.rational.common.test.editor.framework.change.ITestEditorChangeService getOperationService()
IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2013. All rights reserved.