use of com.intellij.ui.JBCardLayout in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoSdkConfigurable method createUIComponents.
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("Getting Go version");
gettingVersionPanel.add(gettingVersionIcon);
gettingVersionPanel.add(new JLabel("Getting..."));
myVersionPanel.add(gettingVersionPanel, VERSION_GETTING);
myVersionPanel.add(myVersionLabel, VERSION_RESULT);
setVersion(null);
}
use of com.intellij.ui.JBCardLayout in project intellij-community by JetBrains.
the class AbstractWizard method initWizard.
private void initWizard(final String title) {
setTitle(title);
myCurrentStep = 0;
myPreviousButton = new JButton(IdeBundle.message("button.wizard.previous"));
myNextButton = new JButton(IdeBundle.message("button.wizard.next"));
myCancelButton = new JButton(CommonBundle.getCancelButtonText());
myHelpButton = new JButton(CommonBundle.getHelpButtonText());
myContentPanel = new JPanel(new JBCardLayout());
myIcon = new TallImageComponent(null);
JRootPane rootPane = getRootPane();
if (rootPane != null) {
// it will be null in headless mode, i.e. tests
rootPane.registerKeyboardAction(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
helpAction();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
rootPane.registerKeyboardAction(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
helpAction();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_HELP, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
}
use of com.intellij.ui.JBCardLayout in project android by JetBrains.
the class ActivityGalleryStep method createGallery.
private JComponent createGallery() {
myGallery = new ASGallery<>();
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 "Add No Activity";
}
}
});
myGallery.setDefaultAction(new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
DynamicWizard wizard = getWizard();
assert wizard != null;
wizard.doNextAction();
}
});
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;
}
use of com.intellij.ui.JBCardLayout in project android by JetBrains.
the class NlPropertiesPanel method setAllPropertiesPanelVisible.
@Override
public void setAllPropertiesPanelVisible(boolean viewAllProperties) {
myAllPropertiesPanelVisible = viewAllProperties;
JBCardLayout cardLayout = (JBCardLayout) myCardPanel.getLayout();
String name = viewAllProperties ? CARD_ADVANCED : CARD_DEFAULT;
Component next = viewAllProperties ? myTable : myInspectorPanel;
cardLayout.swipe(myCardPanel, name, JBCardLayout.SwipeDirection.AUTO, next::requestFocus);
}
use of com.intellij.ui.JBCardLayout in project android by JetBrains.
the class ChooseModuleTypeStep method createGallery.
private JPanel createGallery() {
Dimension thumbnailSize = DEFAULT_GALLERY_THUMBNAIL_SIZE;
myFormFactorGallery = new ASGallery<ModuleTemplate>(JBList.createDefaultListModel(), new Function<ModuleTemplate, Image>() {
@Override
public Image apply(ModuleTemplate input) {
return IconUtil.toImage(input.getIcon());
}
}, new Function<ModuleTemplate, String>() {
@Override
public String apply(@Nullable ModuleTemplate input) {
return input == null ? "<none>" : input.getName();
}
}, thumbnailSize, new AbstractAction() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
DynamicWizard wizard = getWizard();
assert wizard != null;
getWizard().doNextAction();
}
}) {
@Override
public Dimension getPreferredScrollableViewportSize() {
Dimension preferred = getPreferredSize();
int heightInsets = getInsets().top + getInsets().bottom;
// Don't want to show an exact number of rows, since then it's not obvious there's another row available.
return new Dimension(preferred.width, (int) (computeCellSize().height * 2.2) + heightInsets);
}
};
myFormFactorGallery.setMinimumSize(new Dimension(thumbnailSize.width * 2 + 1, thumbnailSize.height));
myFormFactorGallery.setBorder(BorderFactory.createLineBorder(JBColor.border()));
AccessibleContext accessibleContext = myFormFactorGallery.getAccessibleContext();
if (accessibleContext != null) {
accessibleContext.setAccessibleDescription(getStepTitle());
}
JPanel panel = new JPanel(new JBCardLayout());
panel.add("only card", new JBScrollPane(myFormFactorGallery));
return panel;
}
Aggregations