use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class MemberChooser method createSouthPanel.
@Override
protected JComponent createSouthPanel() {
JPanel panel = new JPanel(new GridBagLayout());
customizeOptionsPanel();
JPanel optionsPanel = new JPanel(new VerticalFlowLayout());
for (final JComponent component : myOptionControls) {
optionsPanel.add(component);
}
panel.add(optionsPanel, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
if (!myAllowEmptySelection && (myElements == null || myElements.length == 0)) {
setOKActionEnabled(false);
}
panel.add(super.createSouthPanel(), new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.SOUTH, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
return panel;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class ChangeSignatureDialogBase method createOptionsPanel.
protected JComponent createOptionsPanel() {
final JPanel panel = new JPanel(new BorderLayout());
if (myAllowDelegation) {
myDelegationPanel = createDelegationPanel();
panel.add(myDelegationPanel, BorderLayout.WEST);
}
myPropagateParamChangesButton = new AnActionButton(RefactoringBundle.message("changeSignature.propagate.parameters.title"), null, AllIcons.Hierarchy.Caller) {
@Override
public void actionPerformed(AnActionEvent e) {
final Ref<CallerChooserBase<Method>> chooser = new Ref<>();
Consumer<Set<Method>> callback = callers -> {
myMethodsToPropagateParameters = callers;
myParameterPropagationTreeToReuse = chooser.get().getTree();
};
try {
String message = RefactoringBundle.message("changeSignature.parameter.caller.chooser");
chooser.set(createCallerChooser(message, myParameterPropagationTreeToReuse, callback));
} catch (ProcessCanceledException ex) {
// user cancelled initial callers search, don't show dialog
return;
}
chooser.get().show();
}
};
final JPanel result = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP));
result.add(panel);
return result;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class MoveInstanceMethodDialog method createParametersPanel.
@Nullable
private JPanel createParametersPanel() {
myThisClassesMap = MoveInstanceMembersUtil.getThisClassesToMembers(myMethod);
myOldClassParameterNameFields = new HashMap<>();
if (myThisClassesMap.size() == 0)
return null;
JPanel panel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, true));
for (PsiClass aClass : myThisClassesMap.keySet()) {
final String text = RefactoringBundle.message("move.method.this.parameter.label", ObjectUtils.notNull(aClass.getName(), ""));
panel.add(new TitledSeparator(text, null));
String suggestedName = MoveInstanceMethodHandler.suggestParameterNameForThisClass(aClass);
final EditorTextField field = new EditorTextField(suggestedName, getProject(), StdFileTypes.JAVA);
field.setMinimumSize(new Dimension(field.getPreferredSize()));
myOldClassParameterNameFields.put(aClass, field);
panel.add(field);
}
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
return panel;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project intellij-community by JetBrains.
the class EntryPointsManagerImpl method configureAnnotations.
@Override
public void configureAnnotations() {
final List<String> list = new ArrayList<>(ADDITIONAL_ANNOTATIONS);
final List<String> writeList = new ArrayList<>(myWriteAnnotations);
final JPanel listPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(list, "Mark as entry point if annotated by", true);
Condition<PsiClass> applicableToField = psiClass -> {
Set<PsiAnnotation.TargetType> annotationTargets = AnnotationTargetUtil.getAnnotationTargets(psiClass);
return annotationTargets != null && annotationTargets.contains(PsiAnnotation.TargetType.FIELD);
};
final JPanel writtenAnnotationsPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(writeList, "Mark field as implicitly written if annotated by", false, applicableToField);
new DialogWrapper(myProject) {
{
init();
setTitle("Configure Annotations");
}
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(listPanel);
panel.add(writtenAnnotationsPanel);
return panel;
}
@Override
protected void doOKAction() {
ADDITIONAL_ANNOTATIONS.clear();
ADDITIONAL_ANNOTATIONS.addAll(list);
myWriteAnnotations.clear();
myWriteAnnotations.addAll(writeList);
DaemonCodeAnalyzer.getInstance(myProject).restart();
super.doOKAction();
}
}.show();
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project android by JetBrains.
the class PreviewIconsPanel method initializeIconComponents.
private void initializeIconComponents(@NotNull Collection<Density> densities) {
// Sort the densities, so that we always line up icons from highest to lowest densities.
Ordering<Density> densityOrdering = new Ordering<Density>() {
@Override
public int compare(Density left, Density right) {
// The lower the enum index, the higher the density
return Ints.compare(left.ordinal(), right.ordinal());
}
};
densities = densityOrdering.immutableSortedCopy(densities);
for (Density density : densities) {
JPanel iconPanel = new JPanel(new VerticalFlowLayout(false, false));
iconPanel.setBackground(myTheme.getMainColor());
iconPanel.setOpaque(myTheme != Theme.TRANSPARENT);
JBLabel title = new JBLabel(density.getResourceValue());
title.setForeground(myTheme.getAltColor());
iconPanel.add(title);
ImageComponent iconImage = new ImageComponent(null);
iconImage.setBorder(new LineBorder(myTheme.getAltColor()));
iconImage.setOpaque(false);
iconPanel.add(iconImage);
GridBagConstraints c = new GridBagConstraints();
c.anchor = GridBagConstraints.PAGE_START;
myIconsPanel.add(iconPanel, c);
myIconImages.put(density, iconImage);
}
}
Aggregations