summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Wulfe <benwu@google.com>2014-08-21 18:45:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-08-21 18:45:47 +0000
commit4a86725a4e748d7e4a4e6b8b89a6735516c61f00 (patch)
tree74ce29884d56a237b7cfed858f585e9cb41ac689
parent11e0fa921c0f03107e70704fd2e1126b3def869a (diff)
parent5e871f875a150a48c6d7aa8896e376666c2734a2 (diff)
downloadcloud-4a86725a4e748d7e4a4e6b8b89a6735516c61f00.tar.gz
Merge "Right aligns the Google Login button on the main and nav toolbars using a new interface defined in intelliJ" into idea133
-rw-r--r--login/src/META-INF/plugin.xml3
-rw-r--r--login/src/com/google/gct/login/ui/GoogleLoginAction.java10
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)));
}
-
}