Class ProjectTranslationView
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,org.eclipse.core.runtime.IExecutableExtension,org.eclipse.ui.IPersistable,org.eclipse.ui.IViewPart,org.eclipse.ui.IWorkbenchPart,org.eclipse.ui.IWorkbenchPart2,org.eclipse.ui.IWorkbenchPart3,org.eclipse.ui.part.IWorkbenchPartOrientation
-
Field Summary
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidclear()Clears this view.voidclosed()voidcreatePartControl(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.core.runtime.jobs.JobCreates a job that does a translation work.voiddispose()protected voidhandleStructedSelection(IStructuredSelection selection) protected voidhandleTextSelection(org.eclipse.jface.text.ITextSelection selection) voidhidden()protected voidinitMainControl(org.eclipse.swt.widgets.Composite top) Creates a main control.protected voidinitMenu(org.eclipse.jface.action.IMenuManager menuManager) Initializes a menu actions on the given menu manager.protected voidinitToolBar(org.eclipse.jface.action.IToolBarManager tbm) Initializes items for the given toolbar menu.voidsetActiveText(String text) Sets active text for translating to translate.voidsetProject(ITranslatingProject project) voidsetTargetLanguage(String locale) voidStarts translating.Methods inherited from class com.e1c.langtool.ui.common.tools.AbstractServiceView
addListenerToActiveText, checkInputText, createTranslationText, getActiveText, getApplicalbleObject, getTopComposite, hideError, isErrorVisible, removeListenerFromActiveText, setApplicableObject, setFocus, showError, stopTranslatingMethods inherited from class com.e1c.langtool.ui.common.ManagedViewPart
activated, deactivated, opened, visibleMethods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, init, saveState, setContentDescription, setInitializationData, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapterMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
Constructor Details
-
ProjectTranslationView
public ProjectTranslationView()
-
-
Method Details
-
setActiveText
Description copied from class:AbstractServiceViewSets active text for translating to translate.- Overrides:
setActiveTextin classAbstractServiceView- Parameters:
text- a text for translating
-
setTargetLanguage
-
getTargetLanguage
-
setProject
-
getProject
-
getProjectName
-
createPartControl
public void createPartControl(org.eclipse.swt.widgets.Composite parent) - Specified by:
createPartControlin interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
createPartControlin classAbstractServiceView
-
closed
public void closed()- Overrides:
closedin classManagedViewPart
-
startTranslating
public void startTranslating()Description copied from class:AbstractServiceViewStarts translating.Before start translation process this method calls
AbstractServiceView.stopTranslating()to stop the active translation process if it is present. After that it callsAbstractServiceView.createTranslationJob()to create a new job to run it. It does nothing ifAbstractServiceView.createTranslationJob()method returnsOptional.empty().- Overrides:
startTranslatingin classAbstractServiceView
-
dispose
public void dispose()- Specified by:
disposein interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
disposein classManagedViewPart
-
handleTextSelection
protected void handleTextSelection(org.eclipse.jface.text.ITextSelection selection) -
handleStructedSelection
-
broughtToTop
public void broughtToTop()- Overrides:
broughtToTopin classManagedViewPart
-
initMainControl
protected void initMainControl(org.eclipse.swt.widgets.Composite top) Description copied from class:AbstractServiceViewCreates a main control.In most cases this control is used for showing translation results. This component is located between the text component (for active text) in the top and error component in the bottom (for showing information about errors).
- Specified by:
initMainControlin classAbstractServiceView- Parameters:
top- a parent component for main control
-
clear
protected void clear()Description copied from class:AbstractServiceViewClears this view.It detaches the active applicable object (sets value for object as
Optional.empty()) from this view, sets active text as empty and hides all errors from error component. Also this method should be used for clearing controls that contains not static data (like text fields or tables).- Overrides:
clearin classAbstractServiceView
-
createTranslationJob
protected org.eclipse.core.runtime.jobs.Job createTranslationJob()Description copied from class:AbstractServiceViewCreates a job that does a translation work.- Specified by:
createTranslationJobin classAbstractServiceView- Returns:
- a new translation job or null if it's impossible to create a job
-
initToolBar
protected void initToolBar(org.eclipse.jface.action.IToolBarManager tbm) Description copied from class:AbstractServiceViewInitializes items for the given toolbar menu.- Specified by:
initToolBarin classAbstractServiceView- Parameters:
tbm- a toolbar manager for that items will be added
-
initMenu
protected void initMenu(org.eclipse.jface.action.IMenuManager menuManager) Description copied from class:AbstractServiceViewInitializes a menu actions on the given menu manager.- Overrides:
initMenuin classAbstractServiceView- Parameters:
menuManager- a menu manager for that a menu items will be added
-