use of com.intellij.util.ui.StatusText in project intellij-community by JetBrains.
the class SvnHistoryProvider method getUICustomization.
@Override
public VcsDependentHistoryComponents getUICustomization(final VcsHistorySession session, JComponent forShortcutRegistration) {
final ColumnInfo[] columns;
final Consumer<VcsFileRevision> listener;
final JComponent addComp;
if (((SvnHistorySession) session).isHaveMergeSources()) {
final MergeSourceColumnInfo mergeSourceColumn = new MergeSourceColumnInfo((SvnHistorySession) session);
columns = new ColumnInfo[] { new CopyFromColumnInfo(), mergeSourceColumn };
final JTextArea field = new JTextArea() {
final StatusText statusText = new StatusText(this) {
@Override
protected boolean isStatusVisible() {
return getDocument().getLength() == 0;
}
};
@Override
public Color getBackground() {
return UIUtil.getEditorPaneBackground();
}
{
statusText.setText("Merge sources");
setWrapStyleWord(true);
setLineWrap(true);
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
statusText.paint(this, g);
}
};
field.setEditable(false);
field.setOpaque(false);
field.setWrapStyleWord(true);
listener = vcsFileRevision -> {
field.setText(mergeSourceColumn.getText(vcsFileRevision));
field.setCaretPosition(0);
field.repaint();
};
final MergeSourceDetailsAction sourceAction = new MergeSourceDetailsAction();
sourceAction.registerSelf(forShortcutRegistration);
JPanel fieldPanel = new ToolbarDecorator() {
@Override
protected JComponent getComponent() {
return field;
}
@Override
protected void updateButtons() {
}
@Override
protected void installDnDSupport() {
}
@Override
protected boolean isModelEditable() {
return false;
}
}.initPosition().addExtraAction(AnActionButton.fromAction(sourceAction)).createPanel();
fieldPanel.setBorder(IdeBorderFactory.createEmptyBorder());
addComp = fieldPanel;
} else {
columns = new ColumnInfo[] { new CopyFromColumnInfo() };
addComp = null;
listener = null;
}
return new VcsDependentHistoryComponents(columns, listener, addComp);
}
use of com.intellij.util.ui.StatusText in project intellij-community by JetBrains.
the class ColorOptionsTree method setEmptyText.
public void setEmptyText(@NotNull String text, @Nullable ActionListener linkListener) {
StatusText statusText = getEmptyText();
if (linkListener != null) {
statusText.clear();
statusText.appendText(text + ' ');
statusText.appendText("More...", SimpleTextAttributes.LINK_ATTRIBUTES, linkListener);
} else {
statusText.setText(text);
}
}
use of com.intellij.util.ui.StatusText in project intellij-community by JetBrains.
the class UpdateInfoTree method setChangeLists.
public void setChangeLists(final List<CommittedChangeList> receivedChanges) {
final boolean hasEmptyCaches = CommittedChangesCache.getInstance(myProject).hasEmptyCaches();
ApplicationManager.getApplication().invokeLater(new Runnable() {
public void run() {
if (myLoadingChangeListsLabel != null) {
remove(myLoadingChangeListsLabel);
myLoadingChangeListsLabel = null;
}
myCommittedChangeLists = receivedChanges;
myTreeBrowser.setItems(myCommittedChangeLists, CommittedChangesBrowserUseCase.UPDATE);
if (hasEmptyCaches) {
final StatusText statusText = myTreeBrowser.getEmptyText();
statusText.clear();
statusText.appendText("Click ").appendText("Refresh", SimpleTextAttributes.LINK_ATTRIBUTES, new ActionListener() {
public void actionPerformed(final ActionEvent e) {
RefreshIncomingChangesAction.doRefresh(myProject);
}
}).appendText(" to initialize repository changes cache");
}
}
}, myProject.getDisposed());
}
use of com.intellij.util.ui.StatusText in project intellij-community by JetBrains.
the class JrePathEditor method updateDefaultJrePresentation.
private void updateDefaultJrePresentation() {
StatusText text = myComboboxEditor.getEmptyText();
text.clear();
text.appendText(DEFAULT_JRE_TEXT, SimpleTextAttributes.REGULAR_ATTRIBUTES);
text.appendText(myDefaultJreSelector.getDescriptionString(), SimpleTextAttributes.GRAY_ATTRIBUTES);
}
Aggregations