1) Fixed title pane.

2) Fixed reconnection UI confusion.
3) Added JID to Vcard Profile.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@4647 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Derek DeMoro 2006-07-21 23:14:53 +00:00 committed by derek
parent e09aa9d934
commit 0807e1b794
7 changed files with 76 additions and 23 deletions

View File

@ -26,6 +26,7 @@ import java.awt.Color;
import java.awt.Font;
import java.awt.Insets;
import java.io.File;
import java.io.IOException;
/**
* In many cases, you will need to know the structure of the Spark installation, such as the directory structures, what
@ -96,7 +97,12 @@ public final class Spark {
BIN_DIRECTORY = new File(workingDir, "bin").getAbsoluteFile();
LOG_DIRECTORY = new File(USER_HOME, "/Spark/logs").getAbsoluteFile();
LOG_DIRECTORY.mkdirs();
buf.append(RESOURCE_DIRECTORY.getAbsolutePath()).append(";");
try {
buf.append(RESOURCE_DIRECTORY.getCanonicalPath()).append(";");
}
catch (IOException e) {
e.printStackTrace();
}
}

View File

@ -21,6 +21,7 @@ import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.debugger.EnhancedDebuggerWindow;
import org.jivesoftware.smackx.packet.DelayInformation;
import org.jivesoftware.spark.component.tabbedPane.SparkTabbedPane;
import org.jivesoftware.spark.filetransfer.SparkTransferManager;
import org.jivesoftware.spark.search.SearchManager;
import org.jivesoftware.spark.ui.ChatRoom;
@ -31,7 +32,6 @@ import org.jivesoftware.spark.ui.conferences.Conferences;
import org.jivesoftware.spark.ui.status.StatusBar;
import org.jivesoftware.spark.util.SwingWorker;
import org.jivesoftware.spark.util.log.Log;
import org.jivesoftware.spark.component.tabbedPane.SparkTabbedPane;
import org.jivesoftware.sparkimpl.plugin.manager.Enterprise;
import org.jivesoftware.sparkimpl.plugin.transcripts.ChatTranscriptPlugin;
@ -42,6 +42,7 @@ import javax.swing.JTabbedPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
@ -81,6 +82,12 @@ public class Workspace extends JPanel implements PacketListener {
private List offlineMessages = new ArrayList();
private JPanel cardPanel;
private CardLayout cardLayout;
final public static String WORKSPACE_PANE = "WORKSPACE_PANE";
/**
* Returns the singleton instance of <CODE>Workspace</CODE>,
* creating it if necessary.
@ -134,12 +141,17 @@ public class Workspace extends JPanel implements PacketListener {
// Initialize workspace pane, defaulting the tabs to the bottom.
workspacePane = new SparkTabbedPane(JTabbedPane.BOTTOM);
//workspacePane.setBoldActiveTab(true);
//workspacePane.setHideOneTab(true);
workspacePane.setActiveButtonBold(true);
// Add Panels.
cardLayout = new CardLayout();
cardPanel = new JPanel(cardLayout);
cardPanel.setOpaque(false);
cardPanel.add(WORKSPACE_PANE, workspacePane);
// Build default workspace
this.setLayout(new GridBagLayout());
add(workspacePane, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));
add(cardPanel, new GridBagConstraints(0, 9, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(4, 4, 4, 4), 0, 0));
add(statusBox, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(4, 4, 4, 4), 0, 0));
@ -155,7 +167,7 @@ public class Workspace extends JPanel implements PacketListener {
Color menuBarColor = new Color(235, 233, 237);
setBackground(menuBarColor);
workspacePane.setActiveButtonBold(true);
}
/**
@ -407,4 +419,12 @@ public class Workspace extends JPanel implements PacketListener {
public ContactList getContactList() {
return contactList;
}
public void changeCardLayout(String layout) {
cardLayout.show(cardPanel, layout);
}
public JPanel getCardPanel() {
return cardPanel;
}
}

View File

@ -67,7 +67,7 @@ public final class TitlePanel extends JPanel {
add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0));
add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
setBackground(Color.black);
setBackground(Color.white);
titleLabel.setFont(new Font("dialog", Font.BOLD, 11));
descriptionLabel.setFont(new Font("dialog", 0, 10));

View File

@ -74,7 +74,6 @@ import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
@ -140,8 +139,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
private LocalPreferences localPreferences;
final private static String ROSTER_PANEL = "ROSTER_PANEL";
final private static String RETRY_PANEL = "RETRY_PANEL";
public final static String RETRY_PANEL = "RETRY_PANEL";
// Command Bar
@ -151,6 +149,8 @@ public final class ContactList extends JPanel implements ActionListener, Contact
private RetryPanel retryPanel;
private RetryPanel.ReconnectListener reconnectListener;
private Workspace workspace;
public ContactList() {
// Load Local Preferences
localPreferences = SettingsManager.getLocalPreferences();
@ -172,7 +172,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
renameMenu.addActionListener(this);
setLayout(new CardLayout());
setLayout(new BorderLayout());
addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE));
@ -189,10 +189,14 @@ public final class ContactList extends JPanel implements ActionListener, Contact
treeScroller.getVerticalScrollBar().setBlockIncrement(50);
treeScroller.getVerticalScrollBar().setUnitIncrement(20);
add(treeScroller, ROSTER_PANEL);
retryPanel = new RetryPanel();
add(retryPanel, RETRY_PANEL);
workspace = SparkManager.getWorkspace();
workspace.getCardPanel().add(RETRY_PANEL, retryPanel);
add(mainPanel, BorderLayout.CENTER);
// Load Properties file
props = new Properties();
@ -1971,9 +1975,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
retryPanel.addReconnectionListener(reconnectListener);
}
// Show reconnect panel
CardLayout cl = (CardLayout)getLayout();
cl.show(this, RETRY_PANEL);
workspace.changeCardLayout(RETRY_PANEL);
retryPanel.setDisconnectReason(message);
@ -1989,8 +1991,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
private void removeAllUsers() {
// Show reconnect panel
CardLayout cardLayout = (CardLayout)getLayout();
cardLayout.show(this, ROSTER_PANEL);
workspace.changeCardLayout(RETRY_PANEL);
// Behind the scenes, move everyone to the offline group.
Iterator contactGroups = new ArrayList(getContactGroups()).iterator();
@ -2020,8 +2021,7 @@ public final class ContactList extends JPanel implements ActionListener, Contact
}
}
CardLayout cl = (CardLayout)getLayout();
cl.show(this, ROSTER_PANEL);
workspace.changeCardLayout(Workspace.WORKSPACE_PANE);
}
public void connectionClosedOnError(final Exception ex) {

View File

@ -28,6 +28,9 @@ public class PersonalPanel extends JPanel {
private JTextField lastNameField;
private JTextField nicknameField;
private JTextField emailAddressField;
private JTextField jidField;
private JLabel jidLabel = new JLabel();
public PersonalPanel() {
setLayout(new GridBagLayout());
@ -67,6 +70,16 @@ public class PersonalPanel extends JPanel {
ResourceUtils.resLabel(emaiAddressLabel, emailAddressField, "&Email Address:");
add(emaiAddressLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(emailAddressField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
jidField = new JTextField();
ResourceUtils.resLabel(jidLabel, jidField, "&JID:");
add(jidLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
add(jidField, new GridBagConstraints(1, 6, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
jidLabel.setVisible(false);
jidField.setVisible(false);
}
public String getFirstName() {
@ -114,6 +127,15 @@ public class PersonalPanel extends JPanel {
firstNameField.requestFocus();
}
public void setJID(String jid) {
jidField.setText(jid);
}
public void showJID(boolean show) {
jidLabel.setVisible(show);
jidField.setVisible(show);
}
public void allowEditing(boolean allowEditing) {
Component[] comps = getComponents();
final int no = comps != null ? comps.length : 0;

View File

@ -22,9 +22,9 @@ import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.packet.VCard;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.ui.status.StatusBar;
import org.jivesoftware.spark.component.TitlePanel;
import org.jivesoftware.spark.component.borders.PartialLineBorder;
import org.jivesoftware.spark.ui.status.StatusBar;
import org.jivesoftware.spark.util.GraphicUtils;
import org.jivesoftware.spark.util.ModelUtil;
import org.jivesoftware.spark.util.ResourceUtils;
@ -114,6 +114,8 @@ public class VCardManager {
final JTabbedPane tabbedPane = new JTabbedPane();
personalPanel = new PersonalPanel();
personalPanel.showJID(false);
tabbedPane.addTab("Personal", personalPanel);
businessPanel = new BusinessPanel();
@ -214,6 +216,8 @@ public class VCardManager {
final JTabbedPane tabbedPane = new JTabbedPane();
personalPanel = new PersonalPanel();
personalPanel.showJID(true);
tabbedPane.addTab("Personal", personalPanel);
businessPanel = new BusinessPanel();
@ -485,6 +489,7 @@ public class VCardManager {
personalPanel.setLastName(vcard.getLastName());
personalPanel.setEmailAddress(vcard.getEmailHome());
personalPanel.setNickname(vcard.getNickName());
personalPanel.setJID(vcard.getJabberId());
businessPanel.setCompany(vcard.getOrganization());
businessPanel.setDepartment(vcard.getOrganizationUnit());

View File

@ -17,7 +17,7 @@ public class JiveInfo {
}
public static String getVersion() {
return "1.1.9.2";
return "1.1.9.3";
}
public static String getOS() {