本文整理匯總了Java中com.intellij.openapi.util.SystemInfo.isMacOSLion方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemInfo.isMacOSLion方法的具體用法?Java SystemInfo.isMacOSLion怎麽用?Java SystemInfo.isMacOSLion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.util.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.isMacOSLion方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateFrameBounds
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
private int updateFrameBounds(IdeFrameImpl frame) {
int extendedState = frame.getExtendedState();
if (SystemInfo.isMacOSLion) {
@SuppressWarnings("deprecation") ComponentPeer peer = frame.getPeer();
if (peer instanceof FramePeer) {
// frame.state is not updated by jdk so get it directly from peer
extendedState = ((FramePeer)peer).getState();
}
}
boolean isMaximized = extendedState == Frame.MAXIMIZED_BOTH ||
isFullScreenSupportedInCurrentOS() && frame.isInFullScreen();
boolean usePreviousBounds = isMaximized &&
myFrameBounds != null &&
frame.getBounds().contains(new Point((int)myFrameBounds.getCenterX(), (int)myFrameBounds.getCenterY()));
if (!usePreviousBounds) {
myFrameBounds = frame.getBounds();
}
return extendedState;
}
示例2: updateSelectedTabForeground
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
private void updateSelectedTabForeground() {
if (UIUtil.isUnderAquaLookAndFeel() && SystemInfo.isMacOSLion) {
if (getSelectedIndex() != -1 && getTabComponentAt(getSelectedIndex()) != null) {
getTabComponentAt(getSelectedIndex()).setForeground(Color.WHITE);
}
if (previousSelectedIndex != -1 && getTabComponentAt(previousSelectedIndex) != null) {
getTabComponentAt(previousSelectedIndex).setForeground(JBColor.foreground());
}
}
}
示例3: getExtendedState
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
public static int getExtendedState(Component component) {
int state = Frame.NORMAL;
if (component instanceof Frame) {
state = ((Frame)component).getExtendedState();
if (SystemInfo.isMacOSLion) {
// workaround: frame.state is not updated by jdk so get it directly from peer
@SuppressWarnings("deprecation")
ComponentPeer peer = component.getPeer();
if (peer instanceof FramePeer) {
state = ((FramePeer)peer).getState();
}
}
}
return state;
}
示例4: addSettingsComponent
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
public void addSettingsComponent(Component component) {
if (mySettingComponent == null) {
mySettingComponent = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
mySettingComponent.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
add(mySettingComponent, BorderLayout.WEST);
mySettingComponent.setOpaque(false);
if (!SystemInfo.isMacOSLion || UIUtil.isUnderDarcula()) {
mySettingComponent.setBorder(JBUI.Borders.emptyBottom(4));
}
}
mySettingComponent.add(component);
}
示例5: InlineProgressIndicator
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
public InlineProgressIndicator(boolean compact, @NotNull TaskInfo processInfo) {
myCompact = compact;
myInfo = processInfo;
myCancelButton = new InplaceButton(new IconButton(processInfo.getCancelTooltipText(),
AllIcons.Process.Stop,
AllIcons.Process.StopHovered) {
}, new ActionListener() {
public void actionPerformed(final ActionEvent e) {
cancelRequest();
}
}).setFillBg(true);
myCancelButton.setVisible(myInfo.isCancellable());
myCancelButton.setOpaque(false);
myCancelButton.setToolTipText(processInfo.getCancelTooltipText());
myCancelButton.setFillBg(false);
myProgress = new JProgressBar(SwingConstants.HORIZONTAL);
myProgress.putClientProperty("JComponent.sizeVariant", "mini");
myComponent = new MyComponent(compact, myProcessName);
if (myCompact) {
myComponent.setOpaque(false);
myComponent.setLayout(new BorderLayout(2, 0));
final JPanel textAndProgress = new JPanel(new BorderLayout());
textAndProgress.setOpaque(false);
textAndProgress.add(myText, BorderLayout.CENTER);
final NonOpaquePanel progressWrapper = new NonOpaquePanel(new GridBagLayout());
progressWrapper.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
final GridBagConstraints c = new GridBagConstraints();
c.weightx = 1;
c.weighty = 1;
c.insets = new Insets(SystemInfo.isMacOSLion ? 1 : 0, 0, 1, myInfo.isCancellable() ? 0 : 4);
c.fill = GridBagConstraints.HORIZONTAL;
progressWrapper.add(myProgress, c);
textAndProgress.add(progressWrapper, BorderLayout.EAST);
myComponent.add(textAndProgress, BorderLayout.CENTER);
myComponent.add(myCancelButton, BorderLayout.EAST);
myComponent.setToolTipText(processInfo.getTitle() + ". " + IdeBundle.message("progress.text.clickToViewProgressWindow"));
} else {
myComponent.setLayout(new BorderLayout());
myProcessName.setText(processInfo.getTitle());
myComponent.add(myProcessName, BorderLayout.NORTH);
myProcessName.setForeground(UIUtil.getPanelBackground().brighter().brighter());
myProcessName.setBorder(new EmptyBorder(2, 2, 2, 2));
final NonOpaquePanel content = new NonOpaquePanel(new BorderLayout());
content.setBorder(new EmptyBorder(2, 2, 2, myInfo.isCancellable() ? 2 : 4));
myComponent.add(content, BorderLayout.CENTER);
final Wrapper cancelWrapper = new Wrapper(myCancelButton);
cancelWrapper.setOpaque(false);
cancelWrapper.setBorder(new EmptyBorder(0, 3, 0, 2));
content.add(cancelWrapper, BorderLayout.EAST);
content.add(myText, BorderLayout.NORTH);
content.add(myProgress, BorderLayout.CENTER);
content.add(myText2, BorderLayout.SOUTH);
myComponent.setBorder(new EmptyBorder(2, 2, 2, 2));
}
if (!myCompact) {
myProcessName.recomputeSize();
myText.recomputeSize();
myText2.recomputeSize();
}
}
示例6: isFullScreenSupportedInCurrentOS
import com.intellij.openapi.util.SystemInfo; //導入方法依賴的package包/類
@Override
public boolean isFullScreenSupportedInCurrentOS() {
return SystemInfo.isMacOSLion || SystemInfo.isWindows || SystemInfo.isXWindow && X11UiUtil.isFullScreenSupported();
}