1 19 20 21 package org.netbeans.core.windows; 22 23 24 import org.openide.windows.TopComponent; 25 import org.openide.windows.TopComponentGroup; 26 27 import java.util.Iterator ; 28 import java.util.Set ; 29 30 31 37 public class TopComponentGroupImpl implements TopComponentGroup { 38 39 40 41 public TopComponentGroupImpl(String name) { 42 this(name, false); 43 } 44 45 public TopComponentGroupImpl(String name, boolean opened) { 46 getCentral().createGroupModel(this, name, opened); 47 } 48 49 50 public void open() { 51 WindowManagerImpl.assertEventDispatchThread(); 52 53 getCentral().openGroup(this); 54 } 55 56 public void close() { 57 WindowManagerImpl.assertEventDispatchThread(); 58 59 getCentral().closeGroup(this); 60 } 61 62 public Set <TopComponent> getTopComponents() { 63 return getCentral().getGroupTopComponents(this); 64 } 65 66 67 public String getName() { 68 return getCentral().getGroupName(this); 69 } 70 71 public boolean isOpened() { 72 return getCentral().isGroupOpened(this); 73 } 74 75 public Set <TopComponent> getOpeningSet() { 76 return getCentral().getGroupOpeningTopComponents(this); 77 } 78 79 public Set getClosingSet() { 80 return getCentral().getGroupClosingTopComponents(this); 81 } 82 83 public boolean addUnloadedTopComponent(String tcID) { 84 return getCentral().addGroupUnloadedTopComponent(this, tcID); 85 } 86 87 public boolean removeUnloadedTopComponent(String tcID) { 88 return getCentral().removeGroupUnloadedTopComponent(this, tcID); 89 } 90 91 public boolean addUnloadedOpeningTopComponent(String tcID) { 92 return getCentral().addGroupUnloadedOpeningTopComponent(this, tcID); 93 } 94 95 public boolean removeUnloadedOpeningTopComponent(String tcID) { 96 return getCentral().removeGroupUnloadedOpeningTopComponent(this, tcID); 97 } 98 99 public boolean addUnloadedClosingTopComponent(String tcID) { 100 return getCentral().addGroupUnloadedClosingTopComponent(this, tcID); 101 } 102 103 public boolean removeUnloadedClosingTopComponent(String tcID) { 104 return getCentral().removeGroupUnloadedClosingTopComponent(this, tcID); 105 } 106 107 109 public boolean addGroupUnloadedOpenedTopComponent(String tcID) { 110 return getCentral().addGroupUnloadedOpenedTopComponent(this, tcID); 111 } 112 113 public Set getGroupOpenedTopComponents() { 114 return getCentral().getGroupOpenedTopComponents(this); 115 } 116 117 public Set <String > getTopComponentsIDs() { 119 return getCentral().getGroupTopComponentsIDs(this); 120 } 121 122 public Set <String > getOpeningSetIDs() { 123 return getCentral().getGroupOpeningSetIDs(this); 124 } 125 126 public Set <String > getClosingSetIDs() { 127 return getCentral().getGroupClosingSetIDs(this); 128 } 129 130 public Set <String > getGroupOpenedTopComponentsIDs() { 131 return getCentral().getGroupOpenedTopComponentsIDs(this); 132 } 133 135 private Central getCentral() { 136 return WindowManagerImpl.getInstance().getCentral(); 137 } 138 139 public String toString() { 140 StringBuffer buff = new StringBuffer (); 141 for(Iterator it = getTopComponents().iterator(); it.hasNext(); ) { 142 TopComponent tc = (TopComponent)it.next(); 143 buff.append("\n\t" + tc.getClass().getName() + "@" + Integer.toHexString(tc.hashCode()) + "[name=" + tc.getName() + ", openFlag=" + getOpeningSet().contains(tc) + ", closeFlag=" + getClosingSet().contains(tc) + "]"); } 148 149 return super.toString() + "[topComponents=[" + buff.toString() + "\n]]"; } 151 152 } 153 | Popular Tags |