diff options
author | Benjamin Wulfe <benwu@google.com> | 2014-08-21 18:46:33 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2014-08-21 18:46:33 +0000 |
commit | ea7c94470e0b84f137d84b206c7d0586f65d1d22 (patch) | |
tree | 74ce29884d56a237b7cfed858f585e9cb41ac689 | |
parent | 03a60f9cea2237b62abe1123877258763800b039 (diff) | |
parent | 4a86725a4e748d7e4a4e6b8b89a6735516c61f00 (diff) | |
download | cloud-ea7c94470e0b84f137d84b206c7d0586f65d1d22.tar.gz |
Merge "Right aligns the Google Login button on the main and nav toolbars using a new interface defined in intelliJ" into idea133
automerge: 4a86725
* commit '4a86725a4e748d7e4a4e6b8b89a6735516c61f00':
Right aligns the Google Login button on the main and nav toolbars using a new interface defined in intelliJ
-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))); } - } |