📄 tab.java
字号:
class_mon.enter();
Item tabItems[] = new Item[tabs.size()];
if (tabItems.length > 0)
tabItems = (Item[])(Item[])tabs.keySet().toArray(tabItems);
aitem = tabItems;
class_mon.exit();
return aitem;
Exception exception;
exception;
class_mon.exit();
throw exception;
}
public IView[] getAllViews()
{
IView aiview[];
class_mon.enter();
IView views[] = new IView[tabs.size()];
if (views.length > 0)
views = (IView[])(IView[])tabs.values().toArray(views);
aiview = views;
class_mon.exit();
return aiview;
Exception exception;
exception;
class_mon.exit();
throw exception;
}
public void refresh()
{
Iterator iter;
class_mon.enter();
iter = tabs.keySet().iterator();
_L2:
Item item;
IView view;
if (!iter.hasNext())
break; /* Loop/switch isn't completed */
item = (Item)iter.next();
view = (IView)tabs.get(item);
if (!item.isDisposed())
try
{
String lastTitle = item.getText();
String newTitle = view.getShortTitle();
if (lastTitle == null || !lastTitle.equals(newTitle))
item.setText(escapeAccelerators(newTitle));
if (!(item instanceof CTabItem) && (item instanceof TabItem))
{
String lastToolTip = ((TabItem)item).getToolTipText();
String newToolTip = view.getFullTitle();
if (lastToolTip == null || !lastToolTip.equals(newToolTip))
((TabItem)item).setToolTipText(newToolTip);
}
}
catch (Exception e)
{
Debug.printStackTrace(e);
}
if (true) goto _L2; else goto _L1
_L1:
class_mon.exit();
break MISSING_BLOCK_LABEL_193;
Exception exception;
exception;
class_mon.exit();
throw exception;
}
public void updateLanguage()
{
IView views[];
class_mon.enter();
views = (IView[])(IView[])tabs.values().toArray(new IView[tabs.size()]);
class_mon.exit();
break MISSING_BLOCK_LABEL_56;
Exception exception;
exception;
class_mon.exit();
throw exception;
for (int i = 0; i < views.length; i++)
{
IView view = views[i];
try
{
view.updateLanguage();
view.refresh();
}
catch (Exception e)
{
Debug.printStackTrace(e);
}
}
return;
}
public void closeAllTabs()
{
Item tab_items[];
class_mon.enter();
tab_items = (Item[])(Item[])tabs.keySet().toArray(new Item[tabs.size()]);
class_mon.exit();
break MISSING_BLOCK_LABEL_56;
Exception exception;
exception;
class_mon.exit();
throw exception;
for (int i = 0; i < tab_items.length; i++)
closed(tab_items[i], true);
return;
}
public boolean hasDetails()
{
boolean hasDetails = false;
class_mon.enter();
Iterator iter = tabs.values().iterator();
do
{
if (!iter.hasNext())
break;
IView view = (IView)iter.next();
if (view instanceof ManagerView)
{
hasDetails = true;
break;
}
if (!(view instanceof UIPluginView) || !((UIPluginView)view).getViewID().equals("DMView"))
continue;
hasDetails = true;
break;
} while (true);
class_mon.exit();
break MISSING_BLOCK_LABEL_107;
Exception exception;
exception;
class_mon.exit();
throw exception;
return hasDetails;
}
public void closeAllDetails()
{
Item tab_items[];
class_mon.enter();
tab_items = (Item[])(Item[])tabs.keySet().toArray(new Item[tabs.size()]);
class_mon.exit();
break MISSING_BLOCK_LABEL_56;
Exception exception;
exception;
class_mon.exit();
throw exception;
for (int i = 0; i < tab_items.length; i++)
{
IView view = (IView)tabs.get(tab_items[i]);
if (view instanceof ManagerView)
{
closed(tab_items[i]);
continue;
}
if ((view instanceof UIPluginView) && ((UIPluginView)view).getViewID().equals("DMView"))
closed(tab_items[i]);
}
return;
}
public void closeCurrent()
{
if (folder == null || folder.isDisposed())
return;
if (folder instanceof TabFolder)
{
TabItem items[] = ((TabFolder)folder).getSelection();
if (items.length == 1)
closed(items[0]);
} else
{
closed(((CTabFolder)folder).getSelection());
}
}
public void selectNextTab(boolean selectNext)
{
if (folder == null || folder.isDisposed())
return;
int nextOrPrevious = selectNext ? 1 : -1;
if (folder instanceof TabFolder)
{
TabFolder tabFolder = (TabFolder)folder;
int index = tabFolder.getSelectionIndex() + nextOrPrevious;
if (index == 0 && selectNext || index == -2 || tabFolder.getItemCount() < 2)
return;
if (index == tabFolder.getItemCount())
index = 0;
else
if (index < 0)
index = tabFolder.getItemCount() - 1;
tabFolder.setSelection(index);
} else
{
CTabFolder tabFolder = (CTabFolder)folder;
int index = tabFolder.getSelectionIndex() + nextOrPrevious;
if (index == 0 && selectNext || index == -2 || tabFolder.getItemCount() < 2)
return;
if (index == tabFolder.getItemCount())
index = 0;
else
if (index < 0)
index = tabFolder.getItemCount() - 1;
tabFolder.setSelection(index);
ensureVisibilities();
}
}
public boolean closed(Item item)
{
return closed(item, false);
}
public boolean closed(Item item, boolean bForceClose)
{
IView view;
if (item == null)
return true;
view = (IView)tabs.get(item);
if (!bForceClose && (view instanceof UISWTViewImpl) && !((UISWTViewImpl)view).requestClose())
return false;
class_mon.enter();
view = (IView)tabs.remove(item);
class_mon.exit();
break MISSING_BLOCK_LABEL_82;
Exception exception;
exception;
class_mon.exit();
throw exception;
if (view != null)
{
try
{
if (view instanceof PluginView)
mainwindow.removeActivePluginView(((PluginView)view).getPluginViewName());
if (view instanceof UISWTPluginView)
mainwindow.removeActivePluginView(((UISWTPluginView)view).getPluginViewName());
if (view instanceof UISWTView)
mainwindow.removeActivePluginView(((UISWTView)view).getViewID());
view.delete();
}
catch (Exception e)
{
Debug.printStackTrace(e);
}
if (view instanceof MyTorrentsSuperView)
{
item.dispose();
return true;
}
if (view instanceof MyTrackerView)
{
item.dispose();
return true;
}
if (view instanceof MySharesView)
{
item.dispose();
return true;
}
}
try
{
item.dispose();
}
catch (Exception e)
{
Debug.printStackTrace(e);
}
return true;
}
public void setFocus(Item item)
{
if (item == null || item.isDisposed())
return;
if (folder != null && !folder.isDisposed())
if (useCustomTab)
{
((CTabFolder)folder).setSelection((CTabItem)item);
ensureVisibilities();
} else
{
TabItem items[] = {
(TabItem)item
};
((TabFolder)folder).setSelection(items);
}
}
public void dispose(Item tabItem)
{
IView localView = null;
class_mon.enter();
localView = (IView)tabs.get(tabItem);
if ((localView instanceof UISWTViewImpl) && !((UISWTViewImpl)localView).requestClose())
{
class_mon.exit();
return;
}
tabs.remove(tabItem);
class_mon.exit();
break MISSING_BLOCK_LABEL_75;
Exception exception;
exception;
class_mon.exit();
throw exception;
try
{
if (localView != null)
{
if (localView instanceof PluginView)
mainwindow.removeActivePluginView(((PluginView)localView).getPluginViewName());
if (localView instanceof UISWTPluginView)
mainwindow.removeActivePluginView(((UISWTPluginView)localView).getPluginViewName());
localView.delete();
}
tabItem.dispose();
}
catch (Exception e) { }
return;
}
protected String escapeAccelerators(String str)
{
if (str == null)
return str;
else
return str.replaceAll("&", "&&");
}
public void generateDiagnostics(IndentWriter writer)
{
Object views[] = tabs.values().toArray();
Exception exception;
for (int i = 0; i < views.length; i++)
{
IView view = (IView)views[i];
if (view == null)
continue;
writer.println(view.getFullTitle());
try
{
writer.indent();
view.generateDiagnostics(writer);
}
catch (Exception e)
{
writer.exdent();
continue;
}
finally
{
writer.exdent();
}
writer.exdent();
}
break MISSING_BLOCK_LABEL_88;
throw exception;
}
public void update()
{
if (folder != null)
if (useCustomTab)
((CTabFolder)folder).update();
else
((TabFolder)folder).update();
}
public void closePluginViews(String viewID)
{
Item items[];
if (folder instanceof CTabFolder)
items = ((CTabFolder)folder).getItems();
else
if (folder instanceof TabFolder)
items = ((TabFolder)folder).getItems();
else
return;
for (int i = 0; i < items.length; i++)
{
IView view = getView(items[i]);
if (!(view instanceof UISWTViewImpl))
continue;
String sID = ((UISWTViewImpl)view).getViewID();
if (sID == null || !sID.equals(viewID))
continue;
try
{
Item tab = getTab(view);
if (tab != null)
closed(tab);
}
catch (Exception e)
{
Debug.printStackTrace(e);
}
}
}
public void parameterChanged(String parameterName)
{
if (parameterName.equals("GUI_SWT_bFancyTab") && (folder instanceof CTabFolder) && folder != null && !folder.isDisposed())
try
{
((CTabFolder)folder).setSimple(!COConfigurationManager.getBooleanParameter("GUI_SWT_bFancyTab"));
}
catch (NoSuchMethodError e) { }
}
public IView getCurrentView()
{
TabItem selection[];
if (useCustomTab)
break MISSING_BLOCK_LABEL_33;
selection = ((TabFolder)folder).getSelection();
if (selection.length > 0)
return getView(selection[0]);
return null;
return getView(((CTabFolder)folder).getSelection());
Exception e;
e;
return null;
}
public String getUpdateUIName()
{
IView currentView = getCurrentView();
if (currentView != null)
return (new StringBuilder()).append("TabSet-").append(currentView.getFullTitle()).toString();
else
return "TabSet";
}
public void updateUI()
{
if (folder == null || folder.isDisposed())
return;
IView currentView = getCurrentView();
if (currentView != null)
try
{
currentView.refresh();
}
catch (Exception e)
{
Debug.out(e);
}
refresh();
}
static
{
LOGID = LogIDs.GUI;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -