use of com.intellij.ui.components.JBScrollPane in project android by JetBrains.
the class ChooseActivityTypeStep method init.
private void init(@NotNull List<TemplateHandle> templateList, @NotNull List<AndroidSourceSet> sourceSets, @Nullable AndroidFacet facet) {
myTemplateList = templateList.toArray(new TemplateHandle[templateList.size()]);
mySourceSets = sourceSets;
myActivityGallery = createGallery(getTitle());
myRootPanel = new JBScrollPane(myActivityGallery);
FormScalingUtil.scaleComponentTree(this.getClass(), myRootPanel);
myFacet = facet;
}
use of com.intellij.ui.components.JBScrollPane in project android by JetBrains.
the class MonitorContentFactory method createMonitorContent.
public static void createMonitorContent(@NotNull final Project project, @NotNull DeviceContext deviceContext, @NotNull RunnerLayoutUi layoutUi) {
BaseMonitorView[] monitors = new BaseMonitorView[] { new CpuMonitorView(project, deviceContext), new MemoryMonitorView(project, deviceContext), new NetworkMonitorView(project, deviceContext), new GpuMonitorView(project, deviceContext) };
MonitorPanel monitorPanel = new MonitorPanel(monitors);
JBScrollPane monitorScrollPane = new JBScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
monitorScrollPane.setViewportView(monitorPanel);
monitorScrollPane.getVerticalScrollBar().setUnitIncrement(10);
monitorScrollPane.getHorizontalScrollBar().setUnitIncrement(10);
Content monitorContent = layoutUi.createContent("Monitors", monitorScrollPane, "Monitors", null, null);
monitorContent.setCloseable(false);
layoutUi.addContent(monitorContent);
}
use of com.intellij.ui.components.JBScrollPane 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;
}
use of com.intellij.ui.components.JBScrollPane in project android by JetBrains.
the class ImportDependenciesDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
final JBScrollPane pane = new JBScrollPane(myCheckBoxList);
pane.setPreferredSize(JBUI.size(500, 200));
return pane;
}
use of com.intellij.ui.components.JBScrollPane in project intellij-community by JetBrains.
the class ShowNonRetinaImagesActions method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getProject();
if (project == null)
return;
class ImageInfo {
boolean retina;
boolean normal;
boolean dark;
boolean retina_dark;
}
HashMap<String, ImageInfo> info = new HashMap<>();
final Collection<VirtualFile> images = FilenameIndex.getAllFilesByExt(project, "png", GlobalSearchScope.projectScope(project));
for (VirtualFile image : images) {
final String path = image.getPath();
final String key = toKey(path);
ImageInfo imageInfo = info.get(key);
if (imageInfo == null) {
imageInfo = new ImageInfo();
info.put(key, imageInfo);
}
if (path.endsWith("@2x_dark.png")) {
imageInfo.retina_dark = true;
} else if (path.endsWith("_dark.png")) {
imageInfo.dark = true;
} else if (path.endsWith("@2x.png")) {
imageInfo.retina = true;
} else {
imageInfo.normal = true;
}
}
final ArrayList<String> retinaMissed = new ArrayList<>();
for (String key : info.keySet()) {
if (!info.get(key).retina && info.get(key).normal) {
retinaMissed.add(key);
}
}
Collections.sort(retinaMissed, String.CASE_INSENSITIVE_ORDER);
new DialogWrapper(project) {
{
init();
}
@Nullable
@Override
protected JComponent createCenterPanel() {
return new JBScrollPane(new JTextArea(StringUtil.join(retinaMissed, "\n")));
}
}.show();
}
Aggregations