Package com.e1c.langtool.microsoft.ui
Class MicrosoftTranslatorPreferencePage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
com.e1c.langtool.ui.external.AbstractTranslationPreferencePage
com.e1c.langtool.microsoft.ui.MicrosoftTranslatorPreferencePage
- All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage,org.eclipse.jface.dialogs.IMessageProvider,org.eclipse.jface.preference.IPreferencePage,org.eclipse.ui.IWorkbenchPreferencePage
public class MicrosoftTranslatorPreferencePage
extends AbstractTranslationPreferencePage
implements org.eclipse.ui.IWorkbenchPreferencePage
-
Field Summary
FieldsFields inherited from class com.e1c.langtool.ui.external.AbstractTranslationPreferencePage
isApiKeyValueChangedFields inherited from interface org.eclipse.jface.dialogs.IMessageProvider
ERROR, INFORMATION, NONE, WARNING -
Constructor Summary
ConstructorsConstructorDescriptionMicrosoftTranslatorPreferencePage(ITranslationCacheManager translationCacheManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckAccessKey(String key) Checks an access key for validity.protected voidcreateAccessKeyGroup(org.eclipse.swt.widgets.Composite parent) Creates a group that contains components to work with access (API) key.protected org.eclipse.swt.events.SelectionListenerCreates a selection listener to handle clicks by link to get API key.protected StringReturns inputed API key to check if it valid inAbstractTranslationPreferencePage.checkAccessKey(String).voidinit(org.eclipse.ui.IWorkbench workbench) protected voidInitialize values from preference storo to UI elements.protected voidbooleanprotected voidReload a view that associated with this preference page.protected voidStore values into preference store on apply or OK buttons.Methods inherited from class com.e1c.langtool.ui.external.AbstractTranslationPreferencePage
clearCache, createCheckAccessKeyButton, createClearCacheButton, createClearCacheGroup, createContents, createGetAccessKeyLink, doGetPreferenceStoreMethods inherited from class org.eclipse.jface.preference.PreferencePage
applyData, applyDialogFont, computeSize, contributeButtons, createControl, createDescriptionLabel, createNoteComposite, doComputeSize, getApplyButton, getContainer, getDefaultsButton, getPreferenceStore, isValid, noDefaultAndApplyButton, noDefaultButton, okToLeave, performApply, performCancel, performHelp, setContainer, setErrorMessage, setMessage, setPreferenceStore, setSize, setTitle, setValid, toString, updateApplyButtonMethods inherited from class org.eclipse.jface.dialogs.DialogPage
convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, dispose, getControl, getDescription, getDialogFontName, getErrorMessage, getFont, getImage, getMessage, getMessageType, getShell, getTitle, getToolTipText, initializeDialogUnits, isControlCreated, setButtonLayoutData, setControl, setDescription, setImageDescriptor, setMessage, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jface.dialogs.IDialogPage
createControl, dispose, getControl, getDescription, getErrorMessage, getImage, getMessage, getTitle, performHelp, setDescription, setImageDescriptor, setTitle, setVisibleMethods inherited from interface org.eclipse.jface.preference.IPreferencePage
computeSize, isValid, okToLeave, performCancel, setContainer, setSize
-
Field Details
-
PAGE_ID
- See Also:
-
apiKeyText
protected org.eclipse.swt.widgets.Text apiKeyText
-
-
Constructor Details
-
MicrosoftTranslatorPreferencePage
-
-
Method Details
-
init
public void init(org.eclipse.ui.IWorkbench workbench) - Specified by:
initin interfaceorg.eclipse.ui.IWorkbenchPreferencePage
-
createAccessKeyGroup
protected void createAccessKeyGroup(org.eclipse.swt.widgets.Composite parent) Creates a group that contains components to work with access (API) key.This method creates a group contains a text field to input access key for translation api and button to validate it.
- Specified by:
createAccessKeyGroupin classAbstractTranslationPreferencePage- Parameters:
parent- the composite to which this component will be added- See Also:
-
getAccessKey
Description copied from class:AbstractTranslationPreferencePageReturns inputed API key to check if it valid inAbstractTranslationPreferencePage.checkAccessKey(String).- Specified by:
getAccessKeyin classAbstractTranslationPreferencePage- Returns:
- an access (API) key
-
performOk
public boolean performOk()- Specified by:
performOkin interfaceorg.eclipse.jface.preference.IPreferencePage- Overrides:
performOkin classAbstractTranslationPreferencePage
-
performDefaults
protected void performDefaults()- Overrides:
performDefaultsin classAbstractTranslationPreferencePage
-
checkAccessKey
Description copied from class:AbstractTranslationPreferencePageChecks an access key for validity.- Specified by:
checkAccessKeyin classAbstractTranslationPreferencePage- Parameters:
key- an access key- Returns:
- true if a given key is valid
-
initializeValues
protected void initializeValues()Description copied from class:AbstractTranslationPreferencePageInitialize values from preference storo to UI elements.- Specified by:
initializeValuesin classAbstractTranslationPreferencePage
-
storeValues
protected void storeValues()Description copied from class:AbstractTranslationPreferencePageStore values into preference store on apply or OK buttons.- Specified by:
storeValuesin classAbstractTranslationPreferencePage
-
reloadView
protected void reloadView()Description copied from class:AbstractTranslationPreferencePageReload a view that associated with this preference page.- Specified by:
reloadViewin classAbstractTranslationPreferencePage- See Also:
-
createLinkSelectionListener
protected org.eclipse.swt.events.SelectionListener createLinkSelectionListener()Description copied from class:AbstractTranslationPreferencePageCreates a selection listener to handle clicks by link to get API key.- Specified by:
createLinkSelectionListenerin classAbstractTranslationPreferencePage- See Also:
-
SelectionListenerAbstractTranslationPreferencePage.createGetAccessKeyLink(Composite)
-