Package com.e1c.langtool.google.ui
Class GoogleTranslatePreferencePage
java.lang.Object
org.eclipse.jface.dialogs.DialogPage
org.eclipse.jface.preference.PreferencePage
com.e1c.langtool.ui.external.AbstractTranslationPreferencePage
com.e1c.langtool.google.ui.GoogleTranslatePreferencePage
- All Implemented Interfaces:
org.eclipse.jface.dialogs.IDialogPage,org.eclipse.jface.dialogs.IMessageProvider,org.eclipse.jface.preference.IPreferencePage,org.eclipse.ui.IWorkbenchPreferencePage
public class GoogleTranslatePreferencePage
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
ConstructorsConstructorDescriptionGoogleTranslatePreferencePage(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 voidcreateClientIDGetLink(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.swt.events.SelectionListenerprotected org.eclipse.swt.events.SelectionListenerprotected org.eclipse.swt.events.SelectionListenerprotected org.eclipse.swt.events.SelectionListenerCreates a selection listener to handle clicks by link to get API key.protected voidcreateProjectIDGetLink(org.eclipse.swt.widgets.Composite parent) protected voidcreateRefreshTokenGetLink(org.eclipse.swt.widgets.Composite parent) 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 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, doGetPreferenceStore, performDefaults, performOkMethods 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, performOk, setContainer, setSize
-
Field Details
-
PAGE_ID
- See Also:
-
tokenText
protected org.eclipse.swt.widgets.Text tokenText
-
-
Constructor Details
-
GoogleTranslatePreferencePage
-
-
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) Description copied from class:AbstractTranslationPreferencePageCreates 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
-
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
-
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)
-
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
-
createProjectIDGetLink
protected void createProjectIDGetLink(org.eclipse.swt.widgets.Composite parent) -
createLinkProjectIDSelectionListener
protected org.eclipse.swt.events.SelectionListener createLinkProjectIDSelectionListener() -
createClientIDGetLink
protected void createClientIDGetLink(org.eclipse.swt.widgets.Composite parent) -
createLinkClientIDSelectionListener
protected org.eclipse.swt.events.SelectionListener createLinkClientIDSelectionListener() -
createRefreshTokenGetLink
protected void createRefreshTokenGetLink(org.eclipse.swt.widgets.Composite parent) -
createLinkRefreshTokenSelectionListener
protected org.eclipse.swt.events.SelectionListener createLinkRefreshTokenSelectionListener()
-