Class OllamaLoginWizard
java.lang.Object
org.eclipse.jface.wizard.Wizard
com.developer.nefarious.zjoule.plugin.login.OllamaLoginWizard
- All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
,org.eclipse.jface.wizard.IWizard
public class OllamaLoginWizard
extends org.eclipse.jface.wizard.Wizard
A wizard for handling the Ollama login process.
The OllamaLoginWizard
guides the user through multiple steps
to authenticate with Ollama and configure its endpoint and model settings.
The wizard clears existing sessions before finalizing the login process.
-
Field Summary
Fields inherited from class org.eclipse.jface.wizard.Wizard
DEFAULT_IMAGE
-
Constructor Summary
ConstructorsConstructorDescriptionOllamaLoginWizard
(org.eclipse.swt.browser.Browser browser) Constructs anOllamaLoginWizard
with the specified browser. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPages()
Adds the necessary pages to the wizard for configuring the Ollama login.boolean
Completes the wizard by persisting the login configuration and logging in.Methods inherited from class org.eclipse.jface.wizard.Wizard
addPage, canFinish, createPageControls, dispose, getContainer, getDefaultPageImage, getDialogSettings, getMinimumWizardSize, getNextPage, getPage, getPageCount, getPages, getPreviousPage, getShell, getStartingPage, getTitleBarColor, getWindowTitle, isHelpAvailable, needsPreviousAndNextButtons, needsProgressMonitor, performCancel, setContainer, setDefaultPageImageDescriptor, setDialogSettings, setForcePreviousAndNextButtons, setHelpAvailable, setNeedsProgressMonitor, setTitleBarColor, setWindowTitle
-
Constructor Details
-
OllamaLoginWizard
public OllamaLoginWizard(org.eclipse.swt.browser.Browser browser) Constructs anOllamaLoginWizard
with the specified browser.Initializes the wizard with a title and configures an instance of
OllamaLoginClient
for handling API interactions.- Parameters:
browser
- theBrowser
instance used for authentication.
-
-
Method Details
-
addPages
public void addPages()Adds the necessary pages to the wizard for configuring the Ollama login.The wizard includes:
FirstOllamaLoginWizardPage
- Handles endpoint configuration.SecondOllamaLoginWizardPage
- Handles model selection.
- Specified by:
addPages
in interfaceorg.eclipse.jface.wizard.IWizard
- Overrides:
addPages
in classorg.eclipse.jface.wizard.Wizard
-
performFinish
public boolean performFinish()Completes the wizard by persisting the login configuration and logging in.This method:
- Clears all existing sessions using
SessionManager.clearAllSessions()
. - Persists the Ollama endpoint and model information.
- Triggers the login process using
SessionManager.login(Browser)
.
- Specified by:
performFinish
in interfaceorg.eclipse.jface.wizard.IWizard
- Specified by:
performFinish
in classorg.eclipse.jface.wizard.Wizard
- Returns:
true
to indicate that the login process was successfully completed.
- Clears all existing sessions using
-