diff options
author | Benjamin Wulfe <benwu@google.com> | 2014-07-30 15:31:29 -0400 |
---|---|---|
committer | Benjamin Wulfe <benwu@google.com> | 2014-08-13 13:37:38 +0000 |
commit | 5e871f875a150a48c6d7aa8896e376666c2734a2 (patch) | |
tree | 969ddf9360c07f50a391a900ef42f754cfff36ff | |
parent | 21532aa8314a2b5bd318e9af17b380841c8fa81f (diff) | |
download | cloud-5e871f875a150a48c6d7aa8896e376666c2734a2.tar.gz |
Right aligns the Google Login button on the main and nav toolbars using a new interface defined in intelliJ
Change-Id: I1f5a4d035ee21f55b7b3f2eb38e087c8061b95c9
-rw-r--r-- | login/src/META-INF/plugin.xml | 3 | ||||
-rw-r--r-- | login/src/com/google/gct/login/ui/GoogleLoginAction.java | 10 |
2 files changed, 5 insertions, 8 deletions
diff --git a/login/src/META-INF/plugin.xml b/login/src/META-INF/plugin.xml index 1bd7803..09e0281 100644 --- a/login/src/META-INF/plugin.xml +++ b/login/src/META-INF/plugin.xml @@ -34,7 +34,8 @@ <action id="GoogleLogin.LoginService" class="com.google.gct.login.ui.GoogleLoginAction" text="Google Login"> - <add-to-group group-id="MainToolBar" anchor="first" /> + <add-to-group group-id="MainToolBar" anchor="last" /> + <add-to-group group-id="NavBarToolBar" anchor="last" /> </action> </actions> diff --git a/login/src/com/google/gct/login/ui/GoogleLoginAction.java b/login/src/com/google/gct/login/ui/GoogleLoginAction.java index 51ac706..10e7c0c 100644 --- a/login/src/com/google/gct/login/ui/GoogleLoginAction.java +++ b/login/src/com/google/gct/login/ui/GoogleLoginAction.java @@ -15,10 +15,7 @@ */ package com.google.gct.login.ui; -import com.intellij.openapi.actionSystem.ActionToolbar; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.Presentation; +import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.actionSystem.ex.CustomComponentAction; import com.intellij.openapi.actionSystem.impl.ActionButton; import com.intellij.openapi.ui.popup.ComponentPopupBuilder; @@ -32,7 +29,7 @@ import java.awt.Point; /** * Action to open the Google Login panel. */ -public class GoogleLoginAction extends AnAction implements CustomComponentAction { +public class GoogleLoginAction extends AnAction implements CustomComponentAction, RightAlignedToolbarAction { @Override public void actionPerformed(AnActionEvent e) { @@ -50,8 +47,7 @@ public class GoogleLoginAction extends AnAction implements CustomComponentAction private void showPopup(AnActionEvent e) { GoogleLoginUsersPanel usersPanel = new GoogleLoginUsersPanel(); ComponentPopupBuilder popup = JBPopupFactory.getInstance().createComponentPopupBuilder(usersPanel, usersPanel.getList()); - ActionButton source = (ActionButton)e.getInputEvent().getSource(); + JComponent source = (JComponent)e.getInputEvent().getSource(); popup.createPopup().show(new RelativePoint(source, new Point(0, source.getHeight() - 1))); } - } |