本文整理匯總了Java中org.eclipse.swt.custom.CTabItem.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java CTabItem.equals方法的具體用法?Java CTabItem.equals怎麽用?Java CTabItem.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.CTabItem
的用法示例。
在下文中一共展示了CTabItem.equals方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: mouseUp
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
public void mouseUp(final MouseEvent e) {
// System.out.println("MOUSE up IN TAB FOLDER");
final CTabFolder folder = (CTabFolder) e.widget;
final int x = e.x;
final int y = e.y;
for (final CTabItem item : folder.getItems()) {
final Rectangle r = item.getBounds();
if (r.contains(x, y) && !item.equals(folder.getSelection())) {
System.out.println("Detected problem in editors tab selection (see #2108). Fixed.");
folder.setSelection(item);
folder.update();
return;
}
}
}
示例2: renameTabs
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void renameTabs(CTabItem closedItem, CTabFolder folder) {
CTabItem[] items = folder.getItems();
int count = 1;
for (CTabItem item : items) {
if (closedItem != null && item.equals(closedItem)) {
continue;
}
logger.debug("Setting text: " + TAB_NAME_PREFIX + count);
item.setText(TAB_NAME_PREFIX + count);
count++;
}
}
示例3: okPressed
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
@Override
protected void okPressed() {
CTabItem tabItem = tabFolder.getSelection();
// set a predefined locale...
if (tabItem.equals(tbtmPredefinedLocales)) {
locale = wLocaleList.getSelectedLocale();
} else { // ...set a custom locale
String language = textCustomLanguageCode.getText();
String country = textCustomCountryCode.getText();
String variant = textCustomVariantCode.getText();
if (language != null && language.trim().length() > 0) {
if (country != null && language.trim().length() > 0) {
if (variant != null && variant.trim().length() > 0) {
locale = new Locale(language, country, variant);
} else {
locale = new Locale(language, country);
}
} else {
locale = new Locale(language);
}
}
// language is a mandatory field. If it is not filled,
// just return the selected predefined locale.
else {
locale = wLocaleList.getSelectedLocale();
}
}
super.okPressed();
}