本文整理汇总了Java中org.jivesoftware.Spark.isMac方法的典型用法代码示例。如果您正苦于以下问题:Java Spark.isMac方法的具体用法?Java Spark.isMac怎么用?Java Spark.isMac使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jivesoftware.Spark
的用法示例。
在下文中一共展示了Spark.isMac方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ChatAreaSendField
import org.jivesoftware.Spark; //导入方法依赖的package包/类
/**
* Creates a new IconTextField with Icon.
*
* @param text the text to use on the button.
*/
public ChatAreaSendField(String text) {
setLayout(new GridBagLayout());
setBackground((Color)UIManager.get("TextPane.background"));
textField = new ChatInputEditor();
textField.setBorder(null);
setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, Color.lightGray));
button = new JButton();
if (Spark.isMac()) {
button.setContentAreaFilled(false);
}
ResourceUtils.resButton(button, text);
add(button, new GridBagConstraints(1, 0, 1, 1, 0.0, 1.0, GridBagConstraints.EAST, GridBagConstraints.VERTICAL, new Insets(2, 2, 2, 2), 0, 0));
button.setVisible(false);
final JScrollPane pane = new JScrollPane(textField);
pane.setBorder(null);
add(pane, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(2, 2, 2, 2), 0, 0));
button.setEnabled(false);
}
示例2: getChildElementXML
import org.jivesoftware.Spark; //导入方法依赖的package包/类
public String getChildElementXML() {
StringBuffer buf = new StringBuffer();
buf.append("<query xmlns=\"jabber:iq:spark\">");
// Add os specific information
if (Spark.isWindows()) {
buf.append("<os>windows</os>");
}
else if (Spark.isMac()) {
buf.append("<os>mac</os>");
}
else {
buf.append("<os>linux</os>");
}
buf.append("</query>");
return buf.toString();
}
示例3: getDownloadDir
import org.jivesoftware.Spark; //导入方法依赖的package包/类
/**
* Returns the Download Directory, doesnt return <code>null</code>
* @return {@link String}
*/
public String getDownloadDir() {
File downloadedDir = null;
if (Spark.isLinux() || Spark.isMac()) {
downloadedDir = new File(System.getProperty("user.home") + "/Downloads/");
Log.error(downloadedDir.getAbsolutePath());
} else if (Spark.isWindows()) {
String regpath = WinRegistryReader.getMyDocumentsFromWinRegistry();
if (regpath != null) {
downloadedDir = new File(regpath + "\\Downloads");
if (!downloadedDir.exists()) {
downloadedDir.mkdir();
}
}
else
{
// if for some Reason there is no "My Documents" Folder we should select the Desktop
downloadedDir = new File(System.getProperty("user.home") + "\\Desktop\\");
}
}
return props.getProperty("downloadDirectory", downloadedDir.getAbsolutePath());
}
示例4: changePresence
import org.jivesoftware.Spark; //导入方法依赖的package包/类
/**
* Change the presence of the tray.
*
* @param presence the new presence.
*/
public void changePresence(Presence presence) {
if (Spark.isMac()) {
return;
}
if (presence.getMode() == Presence.Mode.available || presence.getMode() == Presence.Mode.chat) {
setTrayIcon(availableIcon);
}
else if (presence.getMode() == Presence.Mode.away || presence.getMode() == Presence.Mode.xa) {
setTrayIcon(awayIcon);
}
else {
setTrayIcon(dndIcon);
}
// Get Status Text
if (presence.isAvailable()) {
String status = presence.getStatus();
trayIcon.setToolTip(Default.getString(Default.APPLICATION_NAME) + "\n" + status);
}
}
示例5: getLookAndFeel
import org.jivesoftware.Spark; //导入方法依赖的package包/类
public String getLookAndFeel() {
String defaultstring = "";
try {
defaultstring = Spark.isMac() ? Default.getString(Default.DEFAULT_LOOK_AND_FEEL_MAC)
: Default.getString(Default.DEFAULT_LOOK_AND_FEEL);
} catch (Exception e) {
defaultstring = UIManager.getSystemLookAndFeelClassName();
}
if (defaultstring.length() < 1) {
defaultstring = UIManager.getSystemLookAndFeelClassName();
}
return getString("LookAndFeel", defaultstring);
}
示例6: shutdown
import org.jivesoftware.Spark; //导入方法依赖的package包/类
public void shutdown() {
if (Spark.isMac()) {
SparkManager.getNativeManager().removeNativeHandler(this);
}
}
示例7: handleNotification
import org.jivesoftware.Spark; //导入方法依赖的package包/类
public boolean handleNotification() {
return Spark.isMac();
}