use of com.intellij.ui.components.JBLabel in project android by JetBrains.
the class ImportSourceRootsDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout());
panel.setPreferredSize(JBUI.size(350, 200));
final JBLabel label = new JBLabel(AndroidBundle.message("android.import.dependencies.source.roots.dialog.label"));
label.setBorder(JBUI.Borders.empty(0, 0, 5, 0));
panel.add(label, BorderLayout.NORTH);
panel.add(mySourcePathsChooser, BorderLayout.CENTER);
return panel;
}
use of com.intellij.ui.components.JBLabel in project android by JetBrains.
the class NlPropertyInspectorFixture method findPropertyComponent.
@Nullable
private Component findPropertyComponent(@NotNull String name, @Nullable Icon icon) {
try {
JBLabel label = waitUntilFound(robot(), myPanel, new GenericTypeMatcher<JBLabel>(JBLabel.class) {
@Override
protected boolean isMatching(@NotNull JBLabel label) {
return name.equals(label.getText()) && label.getIcon() == icon;
}
});
Container parent = label.getParent();
Component[] components = parent.getComponents();
for (int i = 0; i < components.length; i++) {
if (label == components[i]) {
return components[i + 1];
}
}
return null;
} catch (WaitTimedOutError ex) {
return null;
}
}
use of com.intellij.ui.components.JBLabel in project android by JetBrains.
the class AbstractWizardStepFixture method getValidationText.
public String getValidationText() {
JBLabel validationLabel = robot().finder().findByName(target(), "ValidationLabel", JBLabel.class);
Wait.seconds(1).expecting("validation text to appear").until(() -> validationLabel.getText().matches(".*\\S.*"));
return validationLabel.getText();
}
use of com.intellij.ui.components.JBLabel in project android by JetBrains.
the class ConfigureActivityStep method onEntering.
@Override
protected void onEntering() {
// Verified by shouldSkip
assert getModel().getTargetTemplate() != null;
myRootPanel.removeAll();
int row = 0;
for (String param : getModel().getTargetTemplate().getParameters()) {
myRootPanel.add(new JBLabel(param + ": "), new TabularLayout.Constraint(row, 0));
JBTextField valueTextField = new JBTextField("Value" + (row + 1));
valueTextField.putClientProperty("param", param);
myRootPanel.add(valueTextField, new TabularLayout.Constraint(row, 1));
if (row == 0) {
myPreferredFocus = valueTextField;
}
row++;
}
}
use of com.intellij.ui.components.JBLabel in project android by JetBrains.
the class ZoomLabelAction method createCustomComponent.
@Override
public JComponent createCustomComponent(Presentation presentation) {
JBLabel label = new JBLabel() {
private PropertyChangeListener myPresentationSyncer;
private Presentation myPresentation = presentation;
@Override
public void addNotify() {
super.addNotify();
if (myPresentationSyncer == null) {
myPresentationSyncer = new PresentationSyncer();
myPresentation.addPropertyChangeListener(myPresentationSyncer);
}
setText(myPresentation.getText());
}
@Override
public void removeNotify() {
if (myPresentationSyncer != null) {
myPresentation.removePropertyChangeListener(myPresentationSyncer);
myPresentationSyncer = null;
}
super.removeNotify();
}
class PresentationSyncer implements PropertyChangeListener {
@Override
public void propertyChange(PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if (Presentation.PROP_TEXT.equals(propertyName)) {
setText((String) evt.getNewValue());
invalidate();
repaint();
}
}
}
};
label.setFont(UIUtil.getToolTipFont());
return label;
}
Aggregations