當前位置: 首頁>>代碼示例>>Java>>正文


Java BaseButtonBehavior類代碼示例

本文整理匯總了Java中com.intellij.util.ui.BaseButtonBehavior的典型用法代碼示例。如果您正苦於以下問題:Java BaseButtonBehavior類的具體用法?Java BaseButtonBehavior怎麽用?Java BaseButtonBehavior使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseButtonBehavior類屬於com.intellij.util.ui包,在下文中一共展示了BaseButtonBehavior類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TabContentLayout

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
TabContentLayout(ToolWindowContentUi ui) {
  super(ui);

  myPopupListener = new MyPopupListener();

  new BaseButtonBehavior(myUi) {
    protected void execute(final MouseEvent e) {
      if (!myUi.isCurrent(TabContentLayout.this)) return;

      if (myLastLayout != null) {
        final Rectangle moreRect = myLastLayout.moreRect;
        if (moreRect != null && moreRect.contains(e.getPoint())) {
          showPopup();
        }
      }
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:TabContentLayout.java

示例2: ContentTabLabel

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
public ContentTabLabel(final Content content, TabContentLayout layout) {
  super(layout.myUi, true);
  myLayout = layout;
  myContent = content;
  update();

  myBehavior = new BaseButtonBehavior(this) {
    protected void execute(final MouseEvent e) {
      final ContentManager mgr = contentManager();
      if (mgr.getIndexOfContent(myContent) >= 0) {
        mgr.setSelectedContent(myContent, true);
      }
    }
  };
  myBehavior.setActionTrigger(MouseEvent.MOUSE_PRESSED);
  myBehavior.setMouseDeadzone(TimedDeadzone.NULL);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ContentTabLabel.java

示例3: TabContentLayout

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
TabContentLayout(DesktopToolWindowContentUi ui) {
  super(ui);

  myPopupListener = new MyPopupListener();

  new BaseButtonBehavior(myUi) {
    protected void execute(final MouseEvent e) {
      if (!myUi.isCurrent(TabContentLayout.this)) return;

      if (myLastLayout != null) {
        final Rectangle moreRect = myLastLayout.moreRect;
        if (moreRect != null && moreRect.contains(e.getPoint())) {
          showPopup();
        }
      }
    }
  };
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:19,代碼來源:TabContentLayout.java

示例4: ToolbarAlikeButton

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
private ToolbarAlikeButton(@NotNull final Icon icon) {
  myIcon = icon;

  myBehavior = new BaseButtonBehavior(this, TimedDeadzone.NULL) {
    @Override
    protected void execute(MouseEvent e) {
      onClick(e);
    }
  };

  setOpaque(false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ConfigurationErrorsComponent.java

示例5: Widget

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
private Widget(StatusBar statusBar) {
  myStatusBar = statusBar;
  myPresentation = new WidgetPresentation() {
    @Override
    public String getTooltipText() {
      return "Macro is being recorded now";
    }

    @Override
    public Consumer<MouseEvent> getClickConsumer() {
      return Widget.this;
    }
  };


  new BaseButtonBehavior(myIcon) {
    @Override
    protected void execute(MouseEvent e) {
      showBalloon();
    }
  };

  myBalloonComponent = new NonOpaquePanel(new BorderLayout());

  final AnAction stopAction = ActionManager.getInstance().getAction("StartStopMacroRecording");
  final DefaultActionGroup group = new DefaultActionGroup();
  group.add(stopAction);
  final ActionToolbar tb = ActionManager.getInstance().createActionToolbar(ActionPlaces.STATUS_BAR_PLACE, group, true);
  tb.setMiniMode(true);

  final NonOpaquePanel top = new NonOpaquePanel(new BorderLayout());
  top.add(tb.getComponent(), BorderLayout.WEST);
  myText = new JLabel(RECORDED + "..." + TYPING_SAMPLE, SwingConstants.LEFT);
  final Dimension preferredSize = myText.getPreferredSize();
  myText.setPreferredSize(preferredSize);
  myText.setText("Macro recording started...");
  myLastTyping = "";
  top.add(myText, BorderLayout.CENTER);
  myBalloonComponent.add(top, BorderLayout.CENTER);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:41,代碼來源:ActionMacroManager.java

示例6: ToolbarAlikeButton

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
private ToolbarAlikeButton(@NotNull Icon icon) {
  myIcon = icon;

  myBehavior = new BaseButtonBehavior(this, TimedDeadzone.NULL) {
    @Override
    protected void execute(MouseEvent e) {
      onClick(e);
    }
  };

  setOpaque(false);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ConfigurationErrorsPanel.java

示例7: ToolWindowsWidget

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
private ToolWindowsWidget() {
  new BaseButtonBehavior(this, TimedDeadzone.NULL) {
    @Override
    protected void execute(MouseEvent e) {
      performAction();
    }
  }.setActionTrigger(MouseEvent.MOUSE_PRESSED);

  UISettings.getInstance().addUISettingsListener(this, this);
  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener("focusOwner", this);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:12,代碼來源:IdeStatusBarImpl.java

示例8: ToolWindowsWidget

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
ToolWindowsWidget(@Nonnull Disposable parent) {
  new BaseButtonBehavior(this, TimedDeadzone.NULL) {
    @Override
    protected void execute(MouseEvent e) {
      performAction();
    }
  }.setActionTrigger(MouseEvent.MOUSE_PRESSED);

  IdeEventQueue.getInstance().addDispatcher(e -> {
    if (e instanceof MouseEvent) {
      MouseEvent mouseEvent = (MouseEvent)e;
      if (mouseEvent.getComponent() == null || !SwingUtilities.isDescendingFrom(mouseEvent.getComponent(), SwingUtilities.getWindowAncestor(this))) {
        return false;
      }

      if (e.getID() == MouseEvent.MOUSE_MOVED && isShowing()) {
        Point p = mouseEvent.getLocationOnScreen();
        Point screen = this.getLocationOnScreen();
        if (new Rectangle(screen.x - 4, screen.y - 2, getWidth() + 4, getHeight() + 4).contains(p)) {
          mouseEntered();
          wasExited = false;
        }
        else {
          if (!wasExited) {
            wasExited = mouseExited(p);
          }
        }
      }
      else if (e.getID() == MouseEvent.MOUSE_EXITED) {
        //mouse exits WND
        mouseExited(mouseEvent.getLocationOnScreen());
      }
    }
    return false;
  }, parent);

  ApplicationManager.getApplication().getMessageBus().connect(this).subscribe(UISettingsListener.TOPIC, this);
  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener("focusOwner", this);
  myAlarm = new Alarm(parent);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:41,代碼來源:ToolWindowsWidget.java

示例9: ToolbarAlikeButton

import com.intellij.util.ui.BaseButtonBehavior; //導入依賴的package包/類
ToolbarAlikeButton(@Nonnull final Icon icon) {
  myIcon = icon;

  myBehavior = new BaseButtonBehavior(this, TimedDeadzone.NULL) {
    @Override
    protected void execute(MouseEvent e) {
      onClick(e);
    }
  };

  setOpaque(false);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:13,代碼來源:ConfigurationErrorsComponent.java


注:本文中的com.intellij.util.ui.BaseButtonBehavior類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。