Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2007-06-19 23:57:41 -0400
committerslewis2007-06-19 23:57:41 -0400
commitef083b62235bb7ff4a50522db9916be1e57d7ea2 (patch)
tree628dc38d4d6d79dc62547d536e0aecfd89b74e58
parent09bbecddd9f903929532c73e28a96ba357d7fdd0 (diff)
downloadorg.eclipse.ecf-ef083b62235bb7ff4a50522db9916be1e57d7ea2.tar.gz
org.eclipse.ecf-ef083b62235bb7ff4a50522db9916be1e57d7ea2.tar.xz
org.eclipse.ecf-ef083b62235bb7ff4a50522db9916be1e57d7ea2.zip
-rw-r--r--framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MultiRosterView.java112
-rw-r--r--framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java16
2 files changed, 73 insertions, 55 deletions
diff --git a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MultiRosterView.java b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MultiRosterView.java
index 21140a62c..ec20f1fd5 100644
--- a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MultiRosterView.java
+++ b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/MultiRosterView.java
@@ -152,6 +152,12 @@ public class MultiRosterView extends ViewPart implements IMultiRosterViewPart {
private IAction setInvisibleAction;
private IAction setOfflineAction;
+
+ private IAction showOfflineAction;
+
+ private IAction showEmptyGroupsAction;
+
+ private IAction addContactAction;
private IAction openChatRoomAction;
@@ -578,6 +584,48 @@ public class MultiRosterView extends ViewPart implements IMultiRosterViewPart {
};
setOfflineAction.setChecked(true);
+ showOfflineAction = new Action(Messages.MultiRosterView_ShowOffline,
+ Action.AS_CHECK_BOX) {
+ public void run() {
+ if (isChecked()) {
+ treeViewer.removeFilter(hideOfflineFilter);
+ } else {
+ treeViewer.addFilter(hideOfflineFilter);
+ }
+ }
+ };
+
+ showEmptyGroupsAction = new Action(
+ Messages.MultiRosterView_ShowEmptyGroups, Action.AS_CHECK_BOX) {
+ public void run() {
+ if (isChecked()) {
+ treeViewer.removeFilter(hideEmptyGroupsFilter);
+ } else {
+ treeViewer.addFilter(hideEmptyGroupsFilter);
+ }
+ }
+ };
+
+ addContactAction = new Action(Messages.MultiRosterView_AddContact,
+ SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)) {
+ public void run() {
+ AddContactDialog dialog = new AddContactDialog(treeViewer
+ .getControl().getShell());
+ dialog.setInput(rosterAccounts);
+ if (Window.OK == dialog.open()) {
+ IPresenceContainerAdapter ipca = dialog.getSelection();
+ IRosterSubscriptionSender sender = ipca.getRosterManager()
+ .getRosterSubscriptionSender();
+ try {
+ sender.sendRosterAdd(dialog.getAccountID(), dialog
+ .getAlias(), null);
+ } catch (ECFException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ };
+
openChatRoomAction = new Action() {
public void run() {
selectAndJoinChatRoomForAccounts((MultiRosterAccount[]) rosterAccounts
@@ -793,6 +841,19 @@ public class MultiRosterView extends ViewPart implements IMultiRosterViewPart {
fillLocalPullDown(bars.getMenuManager());
}
+ private void setLocalPullDownEnabled(boolean enabled) {
+ setAvailableAction.setEnabled(enabled);
+ setAwayAction.setEnabled(enabled);
+ setDNDAction.setEnabled(enabled);
+ setInvisibleAction.setEnabled(enabled);
+ setOfflineAction.setEnabled(enabled);
+ showOfflineAction.setEnabled(enabled);
+ showEmptyGroupsAction.setEnabled(enabled);
+ addContactAction.setEnabled(enabled);
+ openChatRoomAction.setEnabled(enabled);
+ disconnectAllAccountsAction.setEnabled(enabled);
+ }
+
private void fillLocalPullDown(IMenuManager manager) {
setStatusMenu = new MenuManager(Messages.MultiRosterView_SetStatusAs,
null);
@@ -801,56 +862,20 @@ public class MultiRosterView extends ViewPart implements IMultiRosterViewPart {
setStatusMenu.add(setDNDAction);
setStatusMenu.add(setInvisibleAction);
setStatusMenu.add(setOfflineAction);
- setStatusMenu.setVisible(false);
manager.add(setStatusMenu);
manager.add(new Separator());
- manager.add(new Action(Messages.MultiRosterView_ShowOffline,
- Action.AS_CHECK_BOX) {
- public void run() {
- if (isChecked()) {
- treeViewer.removeFilter(hideOfflineFilter);
- } else {
- treeViewer.addFilter(hideOfflineFilter);
- }
- }
- });
- IAction showEmptyGroupsAction = new Action(
- Messages.MultiRosterView_ShowEmptyGroups, Action.AS_CHECK_BOX) {
- public void run() {
- if (isChecked()) {
- treeViewer.removeFilter(hideEmptyGroupsFilter);
- } else {
- treeViewer.addFilter(hideEmptyGroupsFilter);
- }
- }
- };
+ manager.add(showOfflineAction);
+
manager.add(showEmptyGroupsAction);
manager.add(new Separator());
- manager.add(new Action(Messages.MultiRosterView_AddContact,
- SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)) {
- public void run() {
- AddContactDialog dialog = new AddContactDialog(treeViewer
- .getControl().getShell());
- dialog.setInput(rosterAccounts);
- if (Window.OK == dialog.open()) {
- IPresenceContainerAdapter ipca = dialog.getSelection();
- IRosterSubscriptionSender sender = ipca.getRosterManager()
- .getRosterSubscriptionSender();
- try {
- sender.sendRosterAdd(dialog.getAccountID(), dialog
- .getAlias(), null);
- } catch (ECFException e) {
- e.printStackTrace();
- }
- }
- }
- });
+ manager.add(addContactAction);
manager.add(new Separator());
manager.add(openChatRoomAction);
manager.add(new Separator());
manager.add(disconnectAllAccountsAction);
+ setLocalPullDownEnabled(false);
}
/*
@@ -879,8 +904,7 @@ public class MultiRosterView extends ViewPart implements IMultiRosterViewPart {
protected boolean addRosterAccount(MultiRosterAccount account) {
boolean result = account != null && rosterAccounts.add(account);
- if (result)
- disconnectAllAccountsAction.setEnabled(true);
+ if (result) setLocalPullDownEnabled(true);
return result;
}
@@ -903,8 +927,8 @@ public class MultiRosterView extends ViewPart implements IMultiRosterViewPart {
treeViewer.remove(account.getRoster());
// Remove account
rosterAccounts.remove(account);
- // Disable disconnect if no more accounts
- disconnectAllAccountsAction.setEnabled(rosterAccounts.size() > 0);
+ // Disable local pull down window if no more accounts
+ setLocalPullDownEnabled(rosterAccounts.size() > 0);
account.dispose();
refreshTreeViewer(null, true);
}
diff --git a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java
index f933088c3..ff0999237 100644
--- a/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java
+++ b/framework/bundles/org.eclipse.ecf.presence.ui/src/org/eclipse/ecf/presence/ui/chatroom/ChatRoomManagerView.java
@@ -75,7 +75,6 @@ import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
@@ -101,11 +100,11 @@ public class ChatRoomManagerView extends ViewPart implements
private static final int RATIO_WRITE_PANE = 1;
- private static final int RATIO_READ_PANE = 7;
+ private static final int RATIO_READ_PANE = 9;
- private static final int RATIO_READ_WRITE_PANE = 85;
+ private static final int RATIO_READ_WRITE_PANE = 90;
- private static final int RATIO_PRESENCE_PANE = 15;
+ private static final int RATIO_PRESENCE_PANE = 10;
protected static final String DEFAULT_ME_COLOR = "0,255,0"; //$NON-NLS-1$
@@ -207,11 +206,8 @@ public class ChatRoomManagerView extends ViewPart implements
rightSash = new SashForm(rightComp, SWT.VERTICAL);
} else
rightSash = new SashForm(parent, SWT.VERTICAL);
- Composite readInlayComp = new Composite(rightSash, SWT.FILL);
- readInlayComp.setLayout(new GridLayout());
- readInlayComp.setLayoutData(new GridData(GridData.FILL_BOTH));
- SourceViewer result = new SourceViewer(readInlayComp, null, null,
+ SourceViewer result = new SourceViewer(rightSash, null, null,
true, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI
| SWT.H_SCROLL | SWT.READ_ONLY);
result.configure(new TextSourceViewerConfiguration(EditorsUI
@@ -222,9 +218,7 @@ public class ChatRoomManagerView extends ViewPart implements
outputText.setEditable(false);
outputText.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite writeComp = new Composite(rightSash, SWT.NONE);
- writeComp.setLayout(new FillLayout());
- inputText = new Text(writeComp, SWT.BORDER | SWT.MULTI | SWT.WRAP
+ inputText = new Text(rightSash, SWT.BORDER | SWT.MULTI | SWT.WRAP
| SWT.V_SCROLL);
if (keyListener != null)
inputText.addKeyListener(keyListener);

Back to the top