• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JBCardLayout类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中com.intellij.ui.JBCardLayout的典型用法代码示例。如果您正苦于以下问题:Java JBCardLayout类的具体用法?Java JBCardLayout怎么用?Java JBCardLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JBCardLayout类属于com.intellij.ui包,在下文中一共展示了JBCardLayout类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: FlatWelcomeScreen

点赞 3

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
@RequiredDispatchThread
public FlatWelcomeScreen(FlatWelcomeFrame welcomeFrame) {
  super(new JBCardLayout());
  myWelcomeFrame = welcomeFrame;
  myMainWelcomePanel = new FlatWelcomePanel(welcomeFrame) {
    @Override
    @RequiredDispatchThread
    public JComponent createActionPanel() {
      return FlatWelcomeScreen.this.createActionPanel(this);
    }
  };
  add(myMainWelcomePanel, MAIN);

  registerKeyboardAction(e -> {
    for (Component component : getComponents()) {
      if (component.isVisible() && component != myMainWelcomePanel) {
        replacePanel((JComponent)component);
        break;
      }
    }
  }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:23,
代码来源:FlatWelcomeScreen.java

示例2: goLeft

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
public ActionCallback goLeft() {
  if (mySelectedIndex == 0) {
    return ActionCallback.REJECTED;
  }
  mySelectedIndex--;
  return applySlide(JBCardLayout.SwipeDirection.BACKWARD);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:8,
代码来源:JBSlidingPanel.java

示例3: swipe

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
public ActionCallback swipe(String id, JBCardLayout.SwipeDirection direction) {
  final ActionCallback done = new ActionCallback();
  getLayout().swipe(this, id, direction, new Runnable() {
    @Override
    public void run() {
      done.setDone();
    }
  });
  return done;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:11,
代码来源:JBSlidingPanel.java

示例4: goRight

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
public ActionCallback goRight() {
  if (mySelectedIndex == mySlides.size() - 1) {
    return ActionCallback.REJECTED;
  }
  mySelectedIndex++;
  return applySlide(JBCardLayout.SwipeDirection.FORWARD);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:8,
代码来源:JBSlidingPanel.java

示例5: applySlide

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private ActionCallback applySlide(JBCardLayout.SwipeDirection direction) {
  final ActionCallback callback = new ActionCallback();
  getLayout().swipe(this, mySlides.get(mySelectedIndex).first, direction, new Runnable() {
    @Override
    public void run() {
      callback.setDone();
    }
  });
  return callback;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:11,
代码来源:JBSlidingPanel.java

示例6: showStepComponent

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private void showStepComponent(final Component component) {
  String id = myComponentToIdMap.get(component);
  if (id == null) {
    id = addStepComponent(component);
    myContentPanel.revalidate();
    myContentPanel.repaint();
  }
  ((JBCardLayout)myContentPanel.getLayout()).swipe(myContentPanel, id, JBCardLayout.SwipeDirection.AUTO);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:10,
代码来源:AbstractWizard.java

示例7: HeaderPanel

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private HeaderPanel(String text, final String parentId) {
  super(new BorderLayout(5, 5));

  setBackground(WelcomeScreenColors.CAPTION_BACKGROUND);

  if (parentId != null) {
    AnAction back = new AnAction("Back", null, AllIcons.Actions.Back) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        myLayout.swipe(myContent, parentId, JBCardLayout.SwipeDirection.BACKWARD);
      }
    };

    ActionToolbar toolbar =
      ActionManager.getInstance().createActionToolbar(ActionPlaces.CONTEXT_TOOLBAR, new DefaultActionGroup(back), true);

    JComponent toolbarComponent = toolbar.getComponent();
    toolbarComponent.setOpaque(false);
    add(toolbarComponent, BorderLayout.WEST);
  }

  JLabel title = new JLabel(text);
  title.setHorizontalAlignment(SwingConstants.CENTER);
  title.setForeground(WelcomeScreenColors.CAPTION_FOREGROUND);
  add(title, BorderLayout.CENTER);
  setBorder(new BottomLineBorder());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:28,
代码来源:CardActionsPanel.java

示例8: initCurrentStep

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private void initCurrentStep(boolean forward) {
  final AbstractCustomizeWizardStep myCurrentStep = mySteps.get(myIndex);
  myCurrentStep.beforeShown(forward);
  myCardLayout.swipe(myContentPanel, myCurrentStep.getTitle(), JBCardLayout.SwipeDirection.AUTO, new Runnable() {
    @Override
    public void run() {
      Component component = myCurrentStep.getDefaultFocusedComponent();
      if (component != null) {
        component.requestFocus();
      }
    }
  });

  myBackButton.setVisible(myIndex > 0);
  if (myIndex > 0) {
    myBackButton.setText("Back to " + mySteps.get(myIndex - 1).getTitle());
  }
  mySkipButton.setText("Skip " + (myIndex > 0 ? "Remaining" : "All") + " and Set Defaults");

  myNextButton.setText(myIndex < mySteps.size() - 1
                       ? "Next: " + mySteps.get(myIndex + 1).getTitle()
                       : "Start using " + ApplicationNamesInfo.getInstance().getFullProductName());
  myHeaderLabel.setText(ensureHTML(myCurrentStep.getHTMLHeader()));
  myFooterLabel.setText(ensureHTML(myCurrentStep.getHTMLFooter()));
  StringBuilder navHTML = new StringBuilder("<html><body>");
  for (int i = 0; i < mySteps.size(); i++) {
    if (i > 0) navHTML.append("&nbsp;&#8594;&nbsp;");
    if (i == myIndex) navHTML.append("<b>");
    navHTML.append(mySteps.get(i).getTitle());
    if (i == myIndex) navHTML.append("</b>");
  }
  myNavigationLabel.setText(navHTML.toString());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:34,
代码来源:CustomizeIDEWizardDialog.java

示例9: createGallery

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private JComponent createGallery() {
  myGallery = new ASGallery<Optional<TemplateEntry>>();
  Dimension thumbnailSize = DEFAULT_GALLERY_THUMBNAIL_SIZE;
  myGallery.setThumbnailSize(thumbnailSize);
  myGallery.setMinimumSize(new Dimension(thumbnailSize.width * 2 + 1, thumbnailSize.height));
  myGallery.setLabelProvider(new Function<Optional<TemplateEntry>, String>() {
    @Override
    public String apply(Optional<TemplateEntry> template) {
      if (template.isPresent()) {
        return template.get().getTitle();
      }
      else {
        return getNoTemplateEntryName();
      }
    }
  });
  myGallery.setImageProvider(new Function<Optional<TemplateEntry>, Image>() {
    @Override
    public Image apply(Optional<TemplateEntry> input) {
      return input.isPresent() ? input.get().getImage() : null;
    }
  });
  myGallery.addListSelectionListener(new ListSelectionListener() {
    @Override
    public void valueChanged(ListSelectionEvent e) {
      saveState(myGallery);
    }
  });
  myGallery.setName("Templates Gallery");
  AccessibleContext accessibleContext = myGallery.getAccessibleContext();
  if (accessibleContext != null) {
    accessibleContext.setAccessibleDescription(getStepTitle());
  }
  JPanel panel = new JPanel(new JBCardLayout());
  panel.add("only card", new JBScrollPane(myGallery));
  return panel;
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:38,
代码来源:ActivityGalleryStep.java

示例10: showDownloadLink

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private void showDownloadLink(final HyperlinkLabel link, final RemotePkgInfo remote, final JPanel cardPanel) {
  link.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      showDownloadWizard(remote.getPkgDesc());
      populateAdditionalFormFactors();
      myFormFactorPanel.validate();
    }
  });
  ((JBCardLayout)cardPanel.getLayout()).show(cardPanel, DOWNLOAD_LINK_CARD);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:12,
代码来源:ConfigureFormFactorStep.java

示例11: createUIComponents

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private void createUIComponents() {
    myVersionLabel = new JBLabel();
    myDefaultLabelColor = myVersionLabel.getForeground();

    myVersionPanel = new JPanel(new JBCardLayout());
    JPanel gettingVersionPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 5, 0));
    AsyncProcessIcon gettingVersionIcon = new AsyncProcessIcon(SquirrelBundle.message("getting.squirrel.sdk.version"));
    gettingVersionPanel.add(gettingVersionIcon);
    gettingVersionPanel.add(new JLabel(SquirrelBundle.message("getting")));
    myVersionPanel.add(gettingVersionPanel, VERSION_GETTING);
    myVersionPanel.add(myVersionLabel, VERSION_RESULT);

    setVersion(null);
}
 

开发者ID:shvetsgroup,
项目名称:squirrel-lang-idea-plugin,
代码行数:15,
代码来源:SquirrelSdkConfigurable.java

示例12: StudyToolWindow

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
public StudyToolWindow() {
  super(true, true);
  myCardLayout = new JBCardLayout();
  myContentPanel = new JPanel(myCardLayout);
  mySplitPane = new OnePixelSplitter(myVertical = true);
}
 

开发者ID:medvector,
项目名称:educational-plugin,
代码行数:7,
代码来源:StudyToolWindow.java

示例13: showPanelById

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
@SuppressWarnings("unused")
public void showPanelById(@NotNull final String panelId) {
  myCardLayout.swipe(myContentPanel, panelId, JBCardLayout.SwipeDirection.AUTO);
}
 

开发者ID:medvector,
项目名称:educational-plugin,
代码行数:5,
代码来源:StudyToolWindow.java

示例14: JBSlidingPanel

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
public JBSlidingPanel() {
  setLayout(new JBCardLayout());
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:4,
代码来源:JBSlidingPanel.java

示例15: getLayout

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
@Override
public JBCardLayout getLayout() {
  return (JBCardLayout)super.getLayout();
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:5,
代码来源:JBSlidingPanel.java

示例16: actionPerformed

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  myLayout.swipe(myContent, myId, JBCardLayout.SwipeDirection.FORWARD);
}
 

开发者ID:jskierbi,
项目名称:intellij-ce-playground,
代码行数:5,
代码来源:CardActionsPanel.java

示例17: initCurrentStep

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
private void initCurrentStep(boolean forward) {
  final AbstractCustomizeWizardStep myCurrentStep = mySteps.get(myIndex);
  boolean disableBack = myCurrentStep.beforeShown(forward);
  myCardLayout.swipe(myContentPanel, myCurrentStep.getTitle(), JBCardLayout.SwipeDirection.AUTO, new Runnable() {
    @Override
    public void run() {
      Component component = myCurrentStep.getDefaultFocusedComponent();
      if (component != null) {
        IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(component);
      }
    }
  });

  myBackButton.setVisible(myIndex > 0);
  if (disableBack) {
    myBackButton.setVisible(false);
    mySkipButton.setVisible(false);
  }
  if (myIndex > 0) {
    myBackButton.setText("Back to " + mySteps.get(myIndex - 1).getTitle());
  }
  mySkipButton.setText("Skip " + (myIndex > 0 ? "Remaining" : "All"));

  boolean nextButton = myIndex < mySteps.size() - 1;
  if (nextButton) {
    myNextButton.setText("Next: " + mySteps.get(myIndex + 1).getTitle());
  }
  else {
    myNextButton.setVisible(false);
  }
  myHeaderLabel.setText(myCurrentStep.getHTMLHeader());
  myFooterLabel.setText(myCurrentStep.getHTMLFooter());
  StringBuilder navHTML = new StringBuilder("<html><body>");
  for (int i = 0; i < mySteps.size(); i++) {
    if (i > 0) navHTML.append("&nbsp;&#8594;&nbsp;");
    if (i == myIndex) navHTML.append("<b>");
    navHTML.append(mySteps.get(i).getTitle());
    if (i == myIndex) navHTML.append("</b>");
  }
  myNavigationLabel.setText(navHTML.toString());
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:42,
代码来源:CustomizeIDEWizardDialog.java

示例18: createActionPanel

点赞 2

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
@RequiredDispatchThread
private JComponent createActionPanel(FlatWelcomePanel welcomePanel) {
  JPanel actions = new NonOpaquePanel();
  actions.setBorder(JBUI.Borders.emptyLeft(10));
  actions.setLayout(new BoxLayout(actions, BoxLayout.Y_AXIS));
  ActionManager actionManager = ActionManager.getInstance();
  ActionGroup quickStart = (ActionGroup)actionManager.getAction(IdeActions.GROUP_WELCOME_SCREEN_QUICKSTART);
  List<AnAction> group = new ArrayList<>();
  collectAllActions(group, quickStart);

  for (AnAction action : group) {
    AnActionEvent e = AnActionEvent.createFromAnAction(action, null, ActionPlaces.WELCOME_SCREEN, DataManager.getInstance().getDataContext(welcomePanel));
    action.update(e);

    if (action instanceof WelcomeScreenSlideAction) {
      final WelcomeScreenSlideAction oldAction = (WelcomeScreenSlideAction)action;
      action = new AnAction() {
        @RequiredDispatchThread
        @Override
        public void actionPerformed(@Nonnull AnActionEvent e) {
          JComponent panel = oldAction.createSlide(myWelcomeFrame, myWelcomeFrame::setTitle);
          JBCardLayout layout = (JBCardLayout)FlatWelcomeScreen.this.getLayout();
          String id = oldAction.getClass().getName();

          FlatWelcomeScreen.this.add(panel, id);

          layout.swipe(FlatWelcomeScreen.this, id, JBCardLayout.SwipeDirection.FORWARD);
        }
      };
      action.copyFrom(oldAction);
    }

    Presentation presentation = e.getPresentation();
    if (presentation.isVisible()) {
      String text = presentation.getText();
      if (text != null && text.endsWith("...")) {
        text = text.substring(0, text.length() - 3);
      }
      ActionLink link = new ActionLink(text, presentation.getIcon(), action, createUsageTracker(action));
      // Don't allow focus, as the containing panel is going to focusable.
      link.setFocusable(false);
      link.setPaintUnderline(false);
      link.setNormalColor(WelcomeScreenConstants.getLinkNormalColor());
      FlatWelcomePanel.JActionLinkPanel button = new FlatWelcomePanel.JActionLinkPanel(link);
      button.setBorder(JBUI.Borders.empty(8, 20));
      if (action instanceof WelcomePopupAction) {
        button.add(FlatWelcomePanel.createArrow(link), BorderLayout.EAST);
      }
      welcomePanel.installFocusable(button, action, KeyEvent.VK_UP, KeyEvent.VK_DOWN, true);
      actions.add(button);
    }
  }

  JPanel panel = new JPanel();
  //panel.setBackground(FlatWelcomeFrame.getMainBackground());
  panel.add(actions);
  return panel;
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:59,
代码来源:FlatWelcomeScreen.java

示例19: replacePanel

点赞 1

import com.intellij.ui.JBCardLayout; //导入依赖的package包/类
public void replacePanel(JComponent oldCard) {
  JBCardLayout layout = (JBCardLayout)getLayout();

  layout.swipe(this, MAIN, JBCardLayout.SwipeDirection.BACKWARD, () -> remove(oldCard));

  myWelcomeFrame.setDefaultTitle();
}
 

开发者ID:consulo,
项目名称:consulo,
代码行数:8,
代码来源:FlatWelcomeScreen.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)