mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ public class IdeStatusBarImpl extends JComponent implements StatusBarEx {
|
||||
setLayout(new BorderLayout(2, 0));
|
||||
setBorder(BorderFactory.createEmptyBorder(1, 4, 0, SystemInfo.isMac ? 2 : 0));
|
||||
|
||||
myInfoAndProgressPanel = new InfoAndProgressPanel(master == null);
|
||||
myInfoAndProgressPanel = new InfoAndProgressPanel();
|
||||
addWidget(myInfoAndProgressPanel, Position.CENTER);
|
||||
|
||||
setOpaque(true);
|
||||
|
||||
+1
-39
@@ -80,13 +80,10 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
|
||||
|
||||
private final Alarm myRefreshAlarm = new Alarm(Alarm.ThreadToUse.SWING_THREAD);
|
||||
private final AnimatedIcon myRefreshIcon;
|
||||
private final EmptyIcon myEmptyRefreshIcon;
|
||||
|
||||
private String myCurrentRequestor;
|
||||
private final boolean myProgressEnabled;
|
||||
|
||||
public InfoAndProgressPanel(boolean progressEnabled) {
|
||||
myProgressEnabled = progressEnabled;
|
||||
public InfoAndProgressPanel() {
|
||||
|
||||
setOpaque(false);
|
||||
|
||||
@@ -111,7 +108,6 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
|
||||
//};
|
||||
|
||||
myRefreshIcon.setPaintPassiveIcon(false);
|
||||
myEmptyRefreshIcon = new EmptyIcon(0, myRefreshIcon.getPreferredSize().height);
|
||||
|
||||
myRefreshAndInfoPanel.setLayout(new BorderLayout());
|
||||
myRefreshAndInfoPanel.setOpaque(false);
|
||||
@@ -528,40 +524,6 @@ public class InfoAndProgressPanel extends JPanel implements CustomStatusBarWidge
|
||||
setLayout(new BorderLayout());
|
||||
add(myRefreshAndInfoPanel, BorderLayout.CENTER);
|
||||
|
||||
//long wastedTime = ProgressManagerImpl.getWastedTime();
|
||||
//if (ApplicationManagerEx.getApplicationEx().isInternal() && wastedTime > 10 * 60 * 1000) {
|
||||
// JPanel wrapper = new JPanel(new BorderLayout());
|
||||
// wrapper.setOpaque(false);
|
||||
// JLabel label = new JLabel(" Wasted time: " + formatTime(wastedTime) + " ");
|
||||
// label.setForeground(UIUtil.getPanelBackground().darker());
|
||||
// label.setOpaque(false);
|
||||
// wrapper.add(label, BorderLayout.CENTER);
|
||||
// wrapper.add(myProgressIcon, BorderLayout.EAST);
|
||||
//
|
||||
// long time = System.currentTimeMillis() - ApplicationManagerEx.getApplicationEx().getStartTime();
|
||||
// long percentage = wastedTime * 100 / time;
|
||||
// String period = new SimpleDateFormat("m 'min' H 'hours'").format(new Date(2000, 0, 1, 0, 0, 0).getTime() + time);
|
||||
//
|
||||
// List<Pair<String, Long>> list = ProgressManagerImpl.getTimeWasters();
|
||||
// StringBuilder s = new StringBuilder("<html>Successfully wasted " + percentage +"% of your time in " + period + ":<br><border>");
|
||||
// for (Pair<String, Long> each : list) {
|
||||
// s.append("<tr><td>");
|
||||
// s.append(each.first);
|
||||
// s.append(":</td><td>");
|
||||
// s.append(formatTime(each.second));
|
||||
// s.append("</td></tr>");
|
||||
// }
|
||||
// s.append("</border></html>");
|
||||
// wrapper.setToolTipText(s.toString());
|
||||
// add(wrapper, BorderLayout.EAST);
|
||||
//} else {
|
||||
|
||||
if (myProgressEnabled) {
|
||||
add(myProgressIcon, BorderLayout.EAST);
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
myProgressIcon.suspend();
|
||||
myRefreshAndInfoPanel.revalidate();
|
||||
myRefreshAndInfoPanel.repaint();
|
||||
|
||||
+2
-7
@@ -88,7 +88,7 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
|
||||
textAndProgress.add(myText, BorderLayout.CENTER);
|
||||
|
||||
final NonOpaquePanel progressWrapper = new NonOpaquePanel(new GridBagLayout());
|
||||
progressWrapper.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
|
||||
progressWrapper.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
|
||||
final GridBagConstraints c = new GridBagConstraints();
|
||||
c.weightx = 1;
|
||||
c.weighty = 1;
|
||||
@@ -278,7 +278,6 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
|
||||
}
|
||||
|
||||
private static class MyProgressBar extends JProgressBar {
|
||||
private static final int MAX_COMPACT_PROGRESS_SIZE = 100;
|
||||
private boolean myActive = true;
|
||||
private final boolean myCompact;
|
||||
|
||||
@@ -309,11 +308,7 @@ public class InlineProgressIndicator extends ProgressIndicatorBase implements Di
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
if (!myActive && myCompact) return new Dimension(0, 0);
|
||||
Dimension preferredSize = super.getPreferredSize();
|
||||
if (myCompact && preferredSize.width > MAX_COMPACT_PROGRESS_SIZE) {
|
||||
return new Dimension(MAX_COMPACT_PROGRESS_SIZE, preferredSize.height);
|
||||
}
|
||||
return preferredSize;
|
||||
return super.getPreferredSize();
|
||||
}
|
||||
|
||||
public void setActive(final boolean active) {
|
||||
|
||||
Reference in New Issue
Block a user