diff --git a/plugin/plugin.xml b/plugin/plugin.xml index ce099145..980fdc93 100644 --- a/plugin/plugin.xml +++ b/plugin/plugin.xml @@ -16,22 +16,16 @@ id="amazonq"> + icon="icons/AmazonQ.png"> - - + class="software.aws.toolkits.eclipse.amazonq.views.LspStartUpFailedView"> - - - - diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/handlers/QOpenLoginViewHandler.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/handlers/QOpenLoginViewHandler.java index d2741a31..20c2c873 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/handlers/QOpenLoginViewHandler.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/handlers/QOpenLoginViewHandler.java @@ -12,11 +12,7 @@ public class QOpenLoginViewHandler extends AbstractHandler { @Override public final Object execute(final ExecutionEvent event) { - if (LspStatusManager.getInstance().lspFailed()) { - ViewVisibilityManager.showLspStartUpFailedView("statusBar"); - } else { - ViewVisibilityManager.showDefaultView("statusBar"); - } + ViewVisibilityManager.showViewContainer("statusBar"); return null; } } diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/plugin/Activator.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/plugin/Activator.java index b8396a7f..64b7a750 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/plugin/Activator.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/plugin/Activator.java @@ -16,10 +16,10 @@ import software.aws.toolkits.eclipse.amazonq.providers.LspProviderImpl; import software.aws.toolkits.eclipse.amazonq.telemetry.service.DefaultTelemetryService; import software.aws.toolkits.eclipse.amazonq.telemetry.service.TelemetryService; +import software.aws.toolkits.eclipse.amazonq.util.PluginLogger; import software.aws.toolkits.eclipse.amazonq.util.CodeReferenceLoggingService; import software.aws.toolkits.eclipse.amazonq.util.DefaultCodeReferenceLoggingService; import software.aws.toolkits.eclipse.amazonq.util.LoggingService; -import software.aws.toolkits.eclipse.amazonq.util.PluginLogger; public class Activator extends AbstractUIPlugin { diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQChatWebview.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQChatWebview.java index 15fda4e2..010e627a 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQChatWebview.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQChatWebview.java @@ -142,7 +142,7 @@ public final void onEvent(final AuthState authState) { // chat view if (browser != null && !browser.isDisposed() && !chatStateManager.hasPreservedState()) { Optional content = getContent(); - if (!content.isPresent()) { + if (!content.isPresent() && !LspStatusManager.getInstance().lspFailed()) { canDisposeState = true; if (!LspStatusManager.getInstance().lspFailed()) { ViewVisibilityManager.showChatAssetMissingView("update"); diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java new file mode 100644 index 00000000..cbd8e0d6 --- /dev/null +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java @@ -0,0 +1,137 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package software.aws.toolkits.eclipse.amazonq.views; + +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StackLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.ui.part.ViewPart; + +import software.aws.toolkits.eclipse.amazonq.broker.api.EventObserver; +import software.aws.toolkits.eclipse.amazonq.plugin.Activator; +import software.aws.toolkits.eclipse.amazonq.views.actions.AmazonQStaticActions; +import software.aws.toolkits.eclipse.amazonq.views.router.AmazonQViewType; + + +public final class AmazonQViewContainer extends ViewPart implements EventObserver { + private Composite parentComposite; + private StackLayout layout; + private Map views; + private AmazonQViewType activeId; + private BaseAmazonQView activeView; + + public AmazonQViewContainer() { + Activator.getEventBroker().subscribe(AmazonQViewType.class, this); + } + + /* Router should be initialized, then init view container + * ViewRouter.Initialize() + * viewcontainer.init(activeViewId) + */ + + /* + * When container is disposed and being reopened, class will be recreated + * need to call showView to reset viewContainer && follow up with init call to container + * 1. showView(viewContainer.ID) + * 2. viewContainer.init(currentView) + */ + + public void initializeViews(final AmazonQViewType currentActiveViewId) { + + //init map containing all views + var dependencyMissingView = new DependencyMissingView(); + var chatAssetMissingView = new ChatAssetMissingView(); + var reAuthView = new ReauthenticateView(); + var lspFailedView = new LspStartUpFailedView(); + views = Map.of( + AmazonQViewType.CHAT_ASSET_MISSING_VIEW, chatAssetMissingView, + AmazonQViewType.DEPENDENCY_MISSING_VIEW, dependencyMissingView, + AmazonQViewType.RE_AUTHENTICATE_VIEW, reAuthView, + AmazonQViewType.LSP_STARTUP_FAILED_VIEW, lspFailedView + ); + + //default view passed in from router + //possible we'll use chatView as default? + activeId = currentActiveViewId; + } + + public void createPartControl(final Composite parent) { + parentComposite = parent; + layout = new StackLayout(); + parent.setLayout(layout); + + //add base stylings + GridLayout gridLayout = new GridLayout(1, false); + gridLayout.marginLeft = 20; + gridLayout.marginRight = 20; + gridLayout.marginTop = 10; + gridLayout.marginBottom = 10; + parent.setLayout(gridLayout); + + setupStaticMenuActions(); + updateChildView(); + } + + /* change methodology for setupMenuActions -- move outside of viewContainer? + * will need ability to switch between the two based on which view is displaying && authState + * if viewId = static view --> new AmazonQStaticActions(getViewSite()); + * if viewId = common view --> new AmazonQCommonActions(AuthState, getViewSite()); + */ + private void setupStaticMenuActions() { + new AmazonQStaticActions(getViewSite()); + } + + private void updateChildView() { + Display.getDefault().asyncExec(() -> { + BaseAmazonQView newView = views.get(activeId); + + if (activeView != null) { + activeView.dispose(); + if (layout.topControl != null) { + layout.topControl.dispose(); + } + } + + Composite newViewComposite = newView.setupView(parentComposite); + GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true); + newViewComposite.setLayoutData(gridData); + + layout.topControl = newViewComposite; + parentComposite.layout(true, true); + + activeView = newView; + }); + } + + @Override + public void onEvent(final AmazonQViewType newViewId) { + if (newViewId.equals(activeId) || !views.containsKey(newViewId)) { + return; + } + activeId = newViewId; + + if (!parentComposite.isDisposed()) { + updateChildView(); + } + } + + @Override + public void setFocus() { + parentComposite.setFocus(); + + } + + @Override + public void dispose() { + if (activeView != null) { + activeView.dispose(); + } + super.dispose(); + } +} diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/BaseAmazonQView.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/BaseAmazonQView.java new file mode 100644 index 00000000..e8bbb999 --- /dev/null +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/BaseAmazonQView.java @@ -0,0 +1,42 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +package software.aws.toolkits.eclipse.amazonq.views; + +import java.io.IOException; +import java.net.URL; + +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; + +import software.aws.toolkits.eclipse.amazonq.plugin.Activator; +import software.aws.toolkits.eclipse.amazonq.util.PluginUtils; + +public abstract class BaseAmazonQView { + public abstract Composite setupView(Composite parentComposite); + public abstract void dispose(); + + protected Image loadImage(final String imagePath) { + Image loadedImage = null; + try { + URL imageUrl = PluginUtils.getResource(imagePath); + if (imageUrl != null) { + loadedImage = new Image(Display.getCurrent(), imageUrl.openStream()); + } + } catch (IOException e) { + Activator.getLogger().warn(e.getMessage(), e); + } + return loadedImage; + } + protected Font magnifyFontSize(final Composite parentComposite, final Font originalFont, final int fontSize) { + FontData[] fontData = originalFont.getFontData(); + for (int i = 0; i < fontData.length; i++) { + fontData[i].setHeight(fontSize); + } + Font magnifiedFont = new Font(parentComposite.getDisplay(), fontData); + return magnifiedFont; + } +} diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/CallToActionView.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/CallToActionView.java index fbeb1f70..6f385ec5 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/CallToActionView.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/CallToActionView.java @@ -5,25 +5,64 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; -public abstract class CallToActionView extends BaseView { +public abstract class CallToActionView extends BaseAmazonQView { private String buttonLabel; private SelectionListener buttonHandler; + private final String iconPath = getIconPath(); + private final String headerLabel = getHeaderLabel(); + private final String detailMessage = getDetailMessage(); + private Image icon; + protected abstract String getButtonLabel(); protected abstract SelectionListener getButtonHandler(); protected abstract void setupButtonFooterContent(Composite composite); @Override - protected final void setupView() { - super.setupView(); + public final Composite setupView(final Composite parentComposite) { + Composite container = new Composite(parentComposite, SWT.NONE); + GridLayout layout = new GridLayout(1, false); + layout.marginWidth = 10; + layout.marginHeight = 10; + container.setLayout(layout); + + // Center the container itself + container.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true)); + + Label iconLabel = new Label(container, SWT.NONE); + icon = loadImage(iconPath); + if (icon != null) { + iconLabel.setImage(icon); + iconLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false)); + + iconLabel.addDisposeListener(e -> { + if (icon != null && !icon.isDisposed()) { + icon.dispose(); + } + }); + } + + Label header = new Label(container, SWT.CENTER | SWT.WRAP); + header.setText(headerLabel); + header.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + + Label detailLabel = new Label(container, SWT.CENTER | SWT.WRAP); + detailLabel.setText(detailMessage); + detailLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + this.buttonLabel = getButtonLabel(); this.buttonHandler = getButtonHandler(); - setupButton(getContentComposite()); - setupButtonFooterContent(getContentComposite()); + setupButton(container); + setupButtonFooterContent(container); + + return container; } private void setupButton(final Composite composite) { @@ -45,4 +84,13 @@ protected void updateButtonStyle(final Button button) { return; } + @Override + public void dispose() { + // Default implementation - subclasses can override if they need to dispose of resources + } + + protected abstract String getIconPath(); + protected abstract String getHeaderLabel(); + protected abstract String getDetailMessage(); + } diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ChatAssetMissingView.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ChatAssetMissingView.java index 8209a6bf..e6a04380 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ChatAssetMissingView.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ChatAssetMissingView.java @@ -3,60 +3,73 @@ package software.aws.toolkits.eclipse.amazonq.views; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; - -import software.aws.toolkits.eclipse.amazonq.plugin.Activator; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; import software.aws.toolkits.eclipse.amazonq.util.ChatAssetProvider; -public final class ChatAssetMissingView extends BaseView { +public final class ChatAssetMissingView extends BaseAmazonQView { public static final String ID = "software.aws.toolkits.eclipse.amazonq.views.ChatAssetMissingView"; private static final String ICON_PATH = "icons/AmazonQ64.png"; private static final String HEADER_LABEL = "Error loading Q chat."; private static final String DETAIL_MESSAGE = "Restart Eclipse or review error logs for troubleshooting"; private ChatAssetProvider chatAssetProvider; + private Image icon; + private Composite container; public ChatAssetMissingView() { this.chatAssetProvider = new ChatAssetProvider(); } @Override - protected String getIconPath() { - return ICON_PATH; - } + public Composite setupView(final Composite parentComposite) { + container = new Composite(parentComposite, SWT.NONE); + GridLayout layout = new GridLayout(1, false); + layout.marginWidth = 20; + layout.marginHeight = 10; + container.setLayout(layout); - @Override - protected String getHeaderLabel() { - return HEADER_LABEL; - } + Label iconLabel = new Label(container, SWT.NONE); + icon = loadImage(ICON_PATH); + if (icon != null) { + iconLabel.setImage(icon); + iconLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false)); - @Override - protected String getDetailMessage() { - return DETAIL_MESSAGE; - } + iconLabel.addDisposeListener(e -> { + if (icon != null && !icon.isDisposed()) { + icon.dispose(); + } + }); + } - @Override - protected CompletableFuture isViewDisplayable() { - return CompletableFuture.supplyAsync(() -> { - try { - Optional chatAsset = chatAssetProvider.get(); - return !chatAsset.isPresent(); - } catch (Exception ex) { - Activator.getLogger().error("Failed to verify Amazon Q chat content is retrievable", ex); - return true; // Safer to display chat asset missing view by default than give access + Label headerLabel = new Label(container, SWT.CENTER | SWT.WRAP); + headerLabel.setText(HEADER_LABEL); + headerLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + var font = magnifyFontSize(parentComposite, parentComposite.getFont(), 18); + headerLabel.setFont(font); + + headerLabel.addDisposeListener(e -> { + if (font != null && !font.isDisposed()) { + font.dispose(); } }); - } - @Override - protected void showAlternateView() { - ViewVisibilityManager.showChatView("restart"); + Label detailLabel = new Label(container, SWT.CENTER | SWT.WRAP); + detailLabel.setText(DETAIL_MESSAGE); + detailLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + + return container; } @Override public void dispose() { - chatAssetProvider.dispose(); - super.dispose(); + if (chatAssetProvider != null) { + chatAssetProvider.dispose(); + chatAssetProvider = null; + } } } diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/DependencyMissingView.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/DependencyMissingView.java index 8a22ac17..c6f3b993 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/DependencyMissingView.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/DependencyMissingView.java @@ -3,18 +3,14 @@ package software.aws.toolkits.eclipse.amazonq.views; -import java.util.concurrent.CompletableFuture; - import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Link; -import software.aws.toolkits.eclipse.amazonq.controllers.AmazonQViewController; import software.aws.toolkits.eclipse.amazonq.plugin.Activator; import software.aws.toolkits.eclipse.amazonq.util.PluginPlatform; import software.aws.toolkits.eclipse.amazonq.util.PluginUtils; @@ -34,11 +30,9 @@ public final class DependencyMissingView extends CallToActionView { private PluginPlatform platform; - private AmazonQViewController viewController; public DependencyMissingView() { platform = PluginUtils.getPlatform(); - viewController = new AmazonQViewController(); } @Override @@ -103,25 +97,4 @@ public void widgetSelected(final SelectionEvent e) { private String getDependency() { return PluginUtils.getPlatform() == PluginPlatform.WINDOWS ? "WebView2" : "WebKit"; } - - @Override - protected CompletableFuture isViewDisplayable() { - return CompletableFuture.supplyAsync(() -> { - try { - Display.getDefault().syncExec(() -> { // Must be executed synchronously to ensure the correct hasWebViewDependency() result - viewController.setupBrowser(getParentComposite()); - viewController.getBrowser().dispose(); - }); - return !viewController.hasWebViewDependency(); - } catch (Exception ex) { - Activator.getLogger().error("Failed to check webview dependency", ex); - return true; // Safer to display dependency missing view by default than give access - } - }); - } - - @Override - protected void showAlternateView() { - ViewVisibilityManager.showChatView("restart"); - } } diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/LspStartUpFailedView.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/LspStartUpFailedView.java index db0e82b2..f384436f 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/LspStartUpFailedView.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/LspStartUpFailedView.java @@ -2,43 +2,72 @@ // SPDX-License-Identifier: Apache-2.0 package software.aws.toolkits.eclipse.amazonq.views; -import java.util.concurrent.CompletableFuture; -import software.aws.toolkits.eclipse.amazonq.lsp.manager.LspStatusManager; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; -public final class LspStartUpFailedView extends BaseView { +public final class LspStartUpFailedView extends BaseAmazonQView { public static final String ID = "software.aws.toolkits.eclipse.amazonq.views.LspStartUpFailedView"; private static final String ICON_PATH = "icons/AmazonQ64.png"; private static final String HEADER_LABEL = "Language Server failed to start."; + + // add logic to base detail_message on error code returned from exception private static final String DETAIL_MESSAGE = "Restart Eclipse or review error logs for troubleshooting"; + private Image icon; + private Composite container; - /* TODO: After refactor of LSP error handling is completed, - * add logic to base detail_message on error code returned from exception - * */ - @Override - protected String getIconPath() { - return ICON_PATH; + public LspStartUpFailedView() { + // } @Override - protected String getHeaderLabel() { - return HEADER_LABEL; - } + public Composite setupView(final Composite parentComposite) { + container = new Composite(parentComposite, SWT.NONE); + GridLayout layout = new GridLayout(1, false); + layout.marginWidth = 20; + layout.marginHeight = 10; + container.setLayout(layout); - @Override - protected String getDetailMessage() { - return DETAIL_MESSAGE; - } + Label iconLabel = new Label(container, SWT.NONE); + icon = loadImage(ICON_PATH); + if (icon != null) { + iconLabel.setImage(icon); + iconLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false)); - @Override - protected void showAlternateView() { - ViewVisibilityManager.showDefaultView("restart"); + iconLabel.addDisposeListener(e -> { + if (icon != null && !icon.isDisposed()) { + icon.dispose(); + } + }); + } + + Label headerLabel = new Label(container, SWT.CENTER | SWT.WRAP); + headerLabel.setText(HEADER_LABEL); + headerLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + var font = magnifyFontSize(parentComposite, parentComposite.getFont(), 18); + headerLabel.setFont(font); + + headerLabel.addDisposeListener(e -> { + if (font != null && !font.isDisposed()) { + font.dispose(); + } + }); + + Label detailLabel = new Label(container, SWT.CENTER | SWT.WRAP); + detailLabel.setText(DETAIL_MESSAGE); + detailLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); + + return container; } @Override - protected CompletableFuture isViewDisplayable() { - return CompletableFuture.completedFuture(LspStatusManager.getInstance().lspFailed()); + public void dispose() { + //default implementation } } diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ReauthenticateView.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ReauthenticateView.java index 6a48a6e5..0c4ab96f 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ReauthenticateView.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ReauthenticateView.java @@ -3,7 +3,6 @@ package software.aws.toolkits.eclipse.amazonq.views; -import java.util.concurrent.CompletableFuture; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -98,7 +97,6 @@ public void widgetSelected(final SelectionEvent e) { } }); } - @Override public void onEvent(final AuthState authState) { Display.getDefault().asyncExec(() -> { @@ -143,15 +141,6 @@ public void dispose() { authStateSubscription.dispose(); } - @Override - protected CompletableFuture isViewDisplayable() { - return CompletableFuture.completedFuture(Activator.getLoginService().getAuthState().isExpired()); - } - - @Override - protected void showAlternateView() { - ViewVisibilityManager.showChatView("restart"); - } private void resizeButtonFont(final Button button, final int newFontSize) { Font currentFont = button.getFont(); diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ViewVisibilityManager.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ViewVisibilityManager.java index 4f6d8656..3e4d799d 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ViewVisibilityManager.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/ViewVisibilityManager.java @@ -28,6 +28,7 @@ private ViewVisibilityManager() { private static final String CODE_REFERENCE_VIEW = AmazonQCodeReferenceView.ID; private static final String LSP_STARTUP_FAILED_VIEW = LspStartUpFailedView.ID; private static final String ERROR_LOG_VIEW = "org.eclipse.pde.runtime.LogView"; + private static final String AMAZON_Q_VIEW_CONTAINER = "software.aws.toolkits.eclipse.amazonq.views.AmazonQViewContainer"; private static final Set MUTUALLY_EXCLUSIVE_VIEWS = Set.of( TOOLKIT_LOGIN_VIEW, @@ -35,7 +36,8 @@ private ViewVisibilityManager() { DEPENDENCY_MISSING_VIEW, RE_AUTHENTICATE_VIEW, CHAT_ASSET_MISSING_VIEW, - LSP_STARTUP_FAILED_VIEW + LSP_STARTUP_FAILED_VIEW, + AMAZON_Q_VIEW_CONTAINER ); public static void showDefaultView(final String source) { @@ -53,6 +55,11 @@ public static void showLoginView(final String source) { showMutuallyExclusiveView(TOOLKIT_LOGIN_VIEW, source); } + public static void showViewContainer(final String source) { + showMutuallyExclusiveView(AMAZON_Q_VIEW_CONTAINER, source); + //put a call here to init viewContainer? + } + public static void showChatView(final String source) { showMutuallyExclusiveView(CHAT_VIEW, source); }