本文整理汇总了Java中org.eclipse.swt.custom.CTabFolderEvent类的典型用法代码示例。如果您正苦于以下问题:Java CTabFolderEvent类的具体用法?Java CTabFolderEvent怎么用?Java CTabFolderEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CTabFolderEvent类属于org.eclipse.swt.custom包,在下文中一共展示了CTabFolderEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void init(Composite parent) {
this.tabFolder = new CTabFolder(parent, SWT.TOP);
this.tabFolder.setTabHeight(TAB_HEIGHT);
this.tabFolder.setLayout(new FillLayout());
this.tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TGTabFolder.this.onTabItemSelected();
}
});
this.tabFolder.addCTabFolder2Listener(new CTabFolder2Adapter() {
public void close(CTabFolderEvent event) {
TGDocument document = (TGDocument) event.item.getData();
if( document != null ) {
closeDocument(document);
event.doit = false;
}
}
});
this.updateDocument();
}
示例2: doConnectionResultConversion
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
private void doConnectionResultConversion(String message, String dbURL) {
setImage(IconLoader.loadIcon("DatabaseIcon"));
setStatus("Requires conversion to the current database format.");
showConversion(message, dbURL.substring("db:".length()));
DBrowser.getTabFolder().addCTabFolder2Listener(new CTabFolder2Adapter() {
public void close(CTabFolderEvent event) {
if (event.item == DbTab.this)
DbTab.this.close();
}
});
DBrowser.createNewTabIfNeeded();
}
示例3: ComponentTitledBorder
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
/**
* Creates a new instance.
*
* @param parent
* @param controller
* @param title
* @param id
*/
public ComponentTitledBorder(Composite parent, Controller controller, String title, String id){
folder = new CTabFolder(parent, SWT.TOP | SWT.BORDER | SWT.FLAT);
folder.setUnselectedCloseVisible(false);
folder.setSimple(false);
// Create help button
if (controller != null) SWTUtil.createHelpButton(controller, folder, id);
// Prevent closing
folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
@Override
public void close(final CTabFolderEvent event) {
event.doit = false;
}
});
// Create general tab
tab = new CTabItem(folder, SWT.NULL);
tab.setText(title);
tab.setShowClose(false);
folder.setSelection(tab);
}
示例4: doConnectionResultSuccess
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
private void doConnectionResultSuccess(DbConnection client, String dbURL, boolean permanent) {
setImage(IconLoader.loadIcon("DatabaseIcon"));
setStatus("Ok");
toolBarMode.setEnabled(true);
refresh();
if (tltmModeRel.getSelection())
showRel();
else if (tltmModeRev.getSelection())
showRev();
else if (tltmModeCmd.getSelection())
showCmd();
else {
// default mode
if (Preferences.getPreferenceBoolean(PreferencePageGeneral.DEFAULT_CMD_MODE)) {
tltmModeCmd.setSelection(true);
showCmd();
} else {
tltmModeRel.setSelection(true);
showRel();
}
}
DBrowser.getTabFolder().addCTabFolder2Listener(new CTabFolder2Adapter() {
public void close(CTabFolderEvent event) {
if (event.item == DbTab.this)
DbTab.this.close();
}
});
DBrowser.createNewTabIfNeeded();
DBrowser.updateRecentlyUsedDatabaseList(dbURL);
}
示例5: close
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void close(CTabFolderEvent event) {
for( int i=0; i<tabList.size(); i++ ) {
TabItem item = tabList.get(i);
if( event.item.equals( item.getSwtTabItem() ) ) {
event.doit = notifyCloseListeners( item );
}
}
}
示例6: createTabFolder
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
/**
* @param content
*/
private void createTabFolder(Composite content) {
CTabFolder folder = new CTabFolder(content, SWT.BORDER | SWT.BOTTOM);
// folder.setSimple(false);
// folder.setUnselectedImageVisible(false);
// folder.setUnselectedCloseVisible(false);
// folder.setMinimizeVisible(true);
// folder.setMaximizeVisible(true);
// configuration
CTabItem startTab = new CTabItem(folder, SWT.NONE);
startTab.setText("TAB1");
Composite config = createMonitorConfig(folder);
startTab.setControl(config);
// monitor info
CTabItem item = new CTabItem(folder, SWT.NONE);
item.setText("TAB2");
Text text = new Text(folder, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
text.setEditable(false);
showRecvMsg(text);
item.setControl(text);
folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
@Override
public void close(CTabFolderEvent event) {
// if (event.item.equals(specialItem)) {
// event.doit = false;
// }
}
});
folder.setSelection(item);
}
示例7: ComponentTitledFolder
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
/**
* Creates a new instance.
*
* @param parent
* @param controller
* @param bar
* @param id
* @param bottom
* @param hasHidingMenu
*/
public ComponentTitledFolder(Composite parent,
Controller controller,
ComponentTitledFolderButtonBar bar,
String id,
Map<Composite, String> helpids,
boolean bottom,
boolean hasHidingMenu){
int flags = SWT.BORDER | SWT.FLAT;
if (bottom) flags |= SWT.BOTTOM;
else flags |= SWT.TOP;
this.hasHidingMenu = hasHidingMenu;
this.folder = new CTabFolder(parent, flags);
this.folder.setUnselectedCloseVisible(false);
this.folder.setSimple(false);
// Create help button
if (bar == null) SWTUtil.createHelpButton(controller, folder, id, helpids);
else createBar(controller, folder, bar);
// Prevent closing
this.folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
@Override
public void close(final CTabFolderEvent event) {
event.doit = false;
}
});
}
示例8: createTabItem
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
private void createTabItem()
{
tabItem = new CTabItem(tabFolder, commandPage.important ? SWT.NONE : SWT.CLOSE);
Color bgc = tabFolder.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT);
tabFolder.setBackground(bgc);
if (commandPage.important)
{
tabItem.setImage(Scripts.getImage(Scripts.IMG_PAGE_REQUIRED));
if (pageFont == null)
{
FontData[] data = tabItem.getFont().getFontData();
data[0].setStyle(SWT.BOLD);
pageFont = new Font(tabFolder.getDisplay(), data[0]);
}
tabItem.setFont(pageFont);
}
else
{
tabItem.setImage(Scripts.getImage(Scripts.IMG_PAGE_OPTIONAL));
tabFolder.addCTabFolder2Listener(new CTabFolder2Adapter()
{
@Override
public void close(CTabFolderEvent event)
{
if (commandPage.lines.size() > 1)
{
event.doit = (showCloseMessage() == SWT.YES);
}
}
});
}
tabItem.setText(commandPage.name + ' ');
}
示例9: createTabItem
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
private void createTabItem()
{
tabItem = new CTabItem(tabFolder, commandPage.important ? SWT.NONE : SWT.CLOSE);
Color bgc = tabFolder.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT);
tabFolder.setBackground(bgc);
if (commandPage.important)
{
tabItem.setImage(Scripts.getImage(Scripts.IMG_PAGE_REQUIRED));
if (pageFont == null)
{
FontData[] data = tabItem.getFont().getFontData();
data[0].setStyle(SWT.BOLD);
pageFont = new Font(tabFolder.getDisplay(), data[0]);
}
tabItem.setFont(pageFont);
}
else
{
tabItem.setImage(Scripts.getImage(Scripts.IMG_PAGE_OPTIONAL));
tabFolder.addCTabFolder2Listener(new CTabFolder2Adapter()
{
@Override
public void close(CTabFolderEvent event)
{
if (event.data != null) return;
event.doit = deletePage();
event.data = new Boolean(event.doit);
// if (commandPage.lines.size() > 1)
// {
// event.doit = (showCloseMessage() == SWT.YES);
// }
}
});
}
tabItem.setText(commandPage.name + ' ');
}
示例10: close
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void close( CTabFolderEvent event ) {
for ( int i = 0; i < tabList.size(); i++ ) {
TabItem item = tabList.get( i );
if ( event.item.equals( item.getSwtTabItem() ) ) {
event.doit = notifyCloseListeners( item );
}
}
}
示例11: createScriptTab
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
private static void createScriptTab() {
tabContent = new CTabFolder(sashFormProgress, SWT.CLOSE | SWT.BORDER);
tabContent.setTabHeight(20);
tabContent.marginHeight = 5;
tabContent.marginWidth = 5;
tabContent.setMaximizeVisible(true);
tabContent.setMinimizeVisible(true);
tabContent.setSelectionBackground(new Color(display, new RGB(153, 186, 243)));
tabContent.setSimple(false);
tabContent.setUnselectedCloseVisible(true);
tabContent.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
if (event.detail == 0) {
System.out.println("%#@%[email protected]#%@#%[email protected]#%%@#");
}
}
});
tabContent.addCTabFolder2Listener(new CTabFolder2Adapter() {
public void close(CTabFolderEvent e) {
CTabItem closingItem = (CTabItem) e.item;
String tabName = closingItem.getText();
//System.out.println("Close "+tabName+" "+closingItem.getData(tabName));
if (!tabName.contains("*")) {
System.out.println("tabName:" + closingItem.getData(tabName));
htTab.remove(closingItem.getData(tabName));
htCaseViewer.remove(closingItem.getData(tabName));
htCaseList.remove(closingItem.getData(tabName));
} else {
int choice = showNotification("是否保存?", SWT.ICON_QUESTION | SWT.YES | SWT.NO
| SWT.CANCEL);
if (choice == SWT.YES) {
saveScript();
htTab.remove(closingItem.getData(tabName.substring(1, tabName.length())));
} else if (choice == SWT.NO)
htTab.remove(closingItem.getData(tabName.substring(1, tabName.length())));
else if (choice == SWT.CANCEL)
e.doit = false;
}
}
});
}
示例12: maximize
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void maximize(CTabFolderEvent event) {
}
示例13: minimize
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void minimize(CTabFolderEvent event) {
}
示例14: showList
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void showList(CTabFolderEvent event) {
}
示例15: restore
import org.eclipse.swt.custom.CTabFolderEvent; //导入依赖的package包/类
public void restore(CTabFolderEvent event) {
}