use of org.jetbrains.plugins.gradle.ui.RichTextControlBuilder in project intellij-community by JetBrains.
the class GradleToolWindowPanel method initContent.
public void initContent() {
final ActionManager actionManager = ActionManager.getInstance();
final ActionGroup actionGroup = (ActionGroup) actionManager.getAction(TOOL_WINDOW_TOOLBAR_ID);
ActionToolbar actionToolbar = actionManager.createActionToolbar(myPlace, actionGroup, true);
JPanel toolbarControl = new JPanel(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridwidth = GridBagConstraints.REMAINDER;
constraints.weightx = 1;
constraints.fill = GridBagConstraints.HORIZONTAL;
constraints.anchor = GridBagConstraints.WEST;
toolbarControl.add(actionToolbar.getComponent(), constraints);
for (JComponent component : getToolbarControls()) {
component.setBorder(IdeBorderFactory.createBorder(SideBorder.TOP));
toolbarControl.add(component, constraints);
}
setToolbar(toolbarControl);
final JComponent payloadControl = buildContent();
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(payloadControl);
JScrollBar scrollBar = scrollPane.getVerticalScrollBar();
myContent.add(scrollPane, CONTENT_CARD_NAME);
RichTextControlBuilder builder = new RichTextControlBuilder();
builder.setBackgroundColor(payloadControl.getBackground());
builder.setForegroundColor(UIUtil.getInactiveTextColor());
builder.setFont(payloadControl.getFont());
builder.setText(GradleBundle.message("gradle.toolwindow.text.no.linked.project"));
final JComponent noLinkedProjectControl = builder.build();
myContent.add(noLinkedProjectControl, NON_LINKED_CARD_NAME);
update();
}
use of org.jetbrains.plugins.gradle.ui.RichTextControlBuilder in project intellij-community by JetBrains.
the class RichTextControlBuilderTest method setUp.
@Before
public void setUp() {
myBuilder = new RichTextControlBuilder();
myMockery = new JUnit4Mockery() {
{
setImposteriser(ClassImposteriser.INSTANCE);
}
};
myProcessor = myMockery.mock(RichTextControlBuilder.RichTextProcessor.class);
myMockery.checking(new Expectations() {
{
allowing(myProcessor).getKey();
will(returnValue(META_KEY));
}
});
myBuilder.registerProcessor(myProcessor);
}
Aggregations