use of com.intellij.ui.components.labels.ActionLink in project intellij-community by JetBrains.
the class RunConfigurable method drawPressAddButtonMessage.
private void drawPressAddButtonMessage(final ConfigurationType configurationType) {
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
panel.setBorder(new EmptyBorder(30, 0, 0, 0));
panel.add(new JLabel("Press the"));
ActionLink addIcon = new ActionLink("", ADD_ICON, myAddAction);
addIcon.setBorder(new EmptyBorder(0, 0, 0, 5));
panel.add(addIcon);
final String configurationTypeDescription = configurationType != null ? configurationType.getConfigurationTypeDescription() : ExecutionBundle.message("run.configuration.default.type.description");
panel.add(new JLabel(ExecutionBundle.message("empty.run.configuration.panel.text.label3", configurationTypeDescription)));
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(panel, true);
myRightPanel.removeAll();
myRightPanel.add(scrollPane, BorderLayout.CENTER);
if (configurationType == null) {
JPanel settingsPanel = new JPanel(new GridBagLayout());
GridBag grid = new GridBag().setDefaultAnchor(GridBagConstraints.NORTHWEST);
for (Pair<UnnamedConfigurable, JComponent> each : myAdditionalSettings) {
settingsPanel.add(each.second, grid.nextLine().next());
}
settingsPanel.add(createSettingsPanel(), grid.nextLine().next());
JPanel wrapper = new JPanel(new BorderLayout());
wrapper.add(settingsPanel, BorderLayout.WEST);
wrapper.add(Box.createGlue(), BorderLayout.CENTER);
myRightPanel.add(wrapper, BorderLayout.SOUTH);
}
myRightPanel.revalidate();
myRightPanel.repaint();
}
use of com.intellij.ui.components.labels.ActionLink in project intellij-community by JetBrains.
the class AbstractGithubTagDownloadedProjectGenerator method createGitHubLink.
public ActionLink createGitHubLink() {
final ActionLink link = new ActionLink(getName() + " on GitHub", new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
BrowserUtil.open("https://github.com/" + getGithubUserName() + "/" + getGithubRepositoryName());
}
});
link.setFont(UIUtil.getLabelFont(UIUtil.FontSize.SMALL));
return link;
}
use of com.intellij.ui.components.labels.ActionLink in project intellij-community by JetBrains.
the class ActionLinkFixture method findByActionId.
@NotNull
public static ActionLinkFixture findByActionId(@NotNull final String actionId, @NotNull final Robot robot, @NotNull final Container container) {
final Ref<ActionLink> actionLinkRef = new Ref<ActionLink>();
pause(new Condition("Find ActionLink with ID '" + actionId + "'") {
@Override
public boolean test() {
Collection<ActionLink> found = robot.finder().findAll(container, new GenericTypeMatcher<ActionLink>(ActionLink.class) {
@Override
protected boolean isMatching(@NotNull ActionLink actionLink) {
if (actionLink.isVisible()) {
AnAction action = actionLink.getAction();
String id = ActionManager.getInstance().getId(action);
return actionId.equals(id);
}
return false;
}
});
if (found.size() == 1) {
actionLinkRef.set(getFirstItem(found));
return true;
}
return false;
}
}, SHORT_TIMEOUT);
ActionLink actionLink = actionLinkRef.get();
if (actionLink == null) {
throw new ComponentLookupException("Failed to find ActionLink with ID '" + actionId + "'");
}
return new ActionLinkFixture(robot, actionLink);
}
use of com.intellij.ui.components.labels.ActionLink in project intellij-community by JetBrains.
the class ActionLinkFixture method findActionLinkByName.
@NotNull
public static ActionLinkFixture findActionLinkByName(@NotNull final String actionName, @NotNull final Robot robot, @NotNull final Container container, @NotNull final Timeout timeout) {
final Ref<ActionLink> actionLinkRef = new Ref<ActionLink>();
pause(new Condition("Find ActionLink with name '" + actionName + "'") {
@Override
public boolean test() {
Collection<ActionLink> found = robot.finder().findAll(container, new GenericTypeMatcher<ActionLink>(ActionLink.class) {
@Override
protected boolean isMatching(@NotNull ActionLink actionLink) {
if (actionLink.isVisible()) {
return actionLink.getText().equals(actionName);
}
return false;
}
});
if (found.size() == 1) {
actionLinkRef.set(getFirstItem(found));
return true;
}
return false;
}
}, timeout);
ActionLink actionLink = actionLinkRef.get();
if (actionLink == null) {
throw new ComponentLookupException("Failed to find ActionLink with name '" + actionName + "'");
}
return new ActionLinkFixture(robot, actionLink);
}
use of com.intellij.ui.components.labels.ActionLink in project intellij-community by JetBrains.
the class ChangeProjectIconForm method createUIComponents.
private void createUIComponents() {
mySetIcon = new ActionLink("Change...", new ChangeProjectIcon(false));
mySetIconDark = new ActionLink("Change...", new ChangeProjectIcon(true));
myClear = new ActionLink("Reset", new ResetProjectIcon(false));
myClearDark = new ActionLink("Reset", new ResetProjectIcon(true));
}
Aggregations