本文整理匯總了Java中org.eclipse.swt.custom.CTabItem.dispose方法的典型用法代碼示例。如果您正苦於以下問題:Java CTabItem.dispose方法的具體用法?Java CTabItem.dispose怎麽用?Java CTabItem.dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.CTabItem
的用法示例。
在下文中一共展示了CTabItem.dispose方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: closeTabWithDatFile
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void closeTabWithDatFile(DatFile df) {
if (View.DUMMY_DATFILE.equals(df) || df == null) {
return;
}
for (CTabItem ti : tabFolder_OpenDatFiles[0].getItems()) {
if (df.equals(ti.getData())) {
ti.dispose();
Project.removeOpenedFile(df);
if (!closeDatfile(df)) {
Project.addOpenedFile(df);
updateTabs();
}
Editor3DWindow.getWindow().getShell().forceFocus();
regainFocus();
break;
}
}
}
示例2: closeView
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
public void closeView() {
try {
// In theory mdi.closeEntry will dispose of the swtItem (ctabitem or other)
// via #close(false). Not sure what happens to composite though,
// so I don't know fi that TYPE_DESTROY actually gets called
// The CTabItem scan seems pointless now, though
Composite c = getComposite();
if (c != null && !c.isDisposed()) {
Composite parent = c.getParent();
triggerEvent(UISWTViewEvent.TYPE_DESTROY, null);
if (parent instanceof CTabFolder) {
for (CTabItem item : ((CTabFolder) parent).getItems()) {
if (item.getControl() == c) {
item.dispose();
}
}
}
}
} catch (Throwable e) {
Debug.out(e);
}
}
示例3: disposeOrphanItems
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void disposeOrphanItems() {
if(!this.isDisposed()) {
List<TGDocument> documents = TGDocumentListManager.getInstance(this.context).getDocuments();
while( this.tabItems.size() > documents.size() ) {
int index = (this.tabItems.size() - 1);
CTabItem cTabItem = this.tabItems.get(index);
cTabItem.dispose();
this.tabItems.remove(index);
}
}
}
示例4: reload
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void reload() {
logger.info("reloading vkeyboard tab list...");
for (CTabItem c : getItems()) {
if (c!=null && !c.isDisposed())
c.dispose();
}
try {
logger.info("loading virtual keyboards from file: "+VK_XML.getAbsolutePath());
conf = new XMLPropertiesConfiguration();
conf.setEncoding("UTF-8");
conf.setFile(VK_XML);
conf.load();
conf.setAutoSave(true);
List<UnicodeList> unicodeLists = loadVirtualKeyboardsXml(conf);
for (UnicodeList ul : unicodeLists) {
addVirtualKeyboardTab(ul);
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
if (getItemCount()>0)
setSelection(0);
}
示例5: removeTabItem
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void removeTabItem(String tabName) {
for (int i = 0; i < tabContent.getItemCount(); i++) {
CTabItem item = tabContent.getItem(i);
String name = item.getText();
if (name.contains("*")) {
if (name.substring(1, name.length()).equals(tabName)) {
item.dispose();
}
} else {
if (name.equals(tabName)) {
item.dispose();
}
}
}
}
示例6: closeTabWithDatfile
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void closeTabWithDatfile(DatFile e) {
CTabItem[] items = tabFolder[0].getItems().clone();
for (CTabItem item : items) {
CompositeTab cTab = (CompositeTab) item;
if (cTab.getState().getFileNameObj().equals(e)) {
item.dispose();
}
}
if (isSeperateWindow() && tabFolder[0].getItemCount() == 0) {
Project.getOpenTextWindows().remove(this);
close();
}
}
示例7: removeItem
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
public void removeItem(final int index) {
final CTabItem item = getUiReference().getItem(index);
items.remove(item);
final Control control = item.getControl();
if (control != null && !control.isDisposed()) {
control.dispose();
}
item.dispose();
}
示例8: removeApplication
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void removeApplication(final IWorkbenchApplication app) {
for (final CTabItem item : tabFolder.getItems()) {
if (item.getData() == app) {
// unselect to clear perspective
final WorkbenchApplicationTree tree = (WorkbenchApplicationTree) item.getControl();
tree.clearSelection(true);
tree.dispose();
item.dispose();
break;
}
}
}
示例9: closeAllTabs
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void closeAllTabs() {
CTabItem[] items = tabFolder[0].getItems().clone();
for (CTabItem item : items) {
item.dispose();
}
}