本文整理匯總了Java中org.eclipse.swt.custom.CTabItem.setImage方法的典型用法代碼示例。如果您正苦於以下問題:Java CTabItem.setImage方法的具體用法?Java CTabItem.setImage怎麽用?Java CTabItem.setImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.custom.CTabItem
的用法示例。
在下文中一共展示了CTabItem.setImage方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addCustomWidgetsToGroupWidget
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void addCustomWidgetsToGroupWidget(
LinkedHashMap<String, ArrayList<Property>> subgroupTree,
String subgroupName, AbstractELTContainerWidget subGroupContainer) {
boolean isError=false;
for(final Property property: subgroupTree.get(subgroupName)){
AbstractWidget eltWidget = addCustomWidgetInGroupWidget(
subGroupContainer, property);
eltWidgetList.add(eltWidget);
if(!eltWidget.isWidgetValid())
{
isError=true;
}
}
if (isError) {
for (CTabItem item : tabFolder.getItems()) {
if (StringUtils.equalsIgnoreCase(StringUtils.trim(item.getText()), subgroupTree
.get(subgroupName).get(0).getPropertyGroup())) {
item.setImage(ImagePathConstant.COMPONENT_ERROR_ICON.getImageFromRegistry());
}
}
}
}
示例2: loadCompareViewers
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
protected void loadCompareViewers() {
List<CompareViewerFactory> compareViewerFactories = loadViewerFactories();
compareViewers = new Vector<CompareViewer>(compareViewerFactories.size());
for (CompareViewerFactory cvf : compareViewerFactories)
{
CTabItem tabItem = new CTabItem(tabFolder, SWT.None);
tabItem.setText(cvf.getCompareViewerName());
tabItem.setImage(cvf.getCompareViewerIcon());
Composite c = new Composite(tabFolder, SWT.NONE);
tabItem.setControl(c);
CompareViewer viewer = cvf.createViewer(c, SWT.NONE);
if (viewer != null)
{
compareViewers.add(viewer);
}
}
}
示例3: createTableTab
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private CTabItem createTableTab()
{
CTabItem tab = new CTabItem(tabs, SWT.NONE);
tab.setText("Table");
tab.setImage(ch.ivyteam.swt.icons.IconFactory.get(this).getTable(Size.SIZE_16));
Group grpDecisions = new Group(tabs, SWT.NONE);
grpDecisions.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
grpDecisions.setText("Decisions");
grpDecisions.setLayout(new GridLayout(1, false));
tab.setControl(grpDecisions);
columnEdit = new ColumnEditActionsComposite(grpDecisions, SWT.NONE);
columnEdit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
addDataChooser();
table = new DecisionTableComposite(grpDecisions, SWT.NONE);
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
return tab;
}
示例4: buildContents
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void buildContents() {
tabFolder = new CTabFolder(shell, SWT.TOP | SWT.NO_TRIM);
tabFolder.setBorderVisible(true);
tabFolder.setBackgroundMode(SWT.INHERIT_DEFAULT);
tabFolder.setMRUVisible(true);
tabFolder.setSimple(false); // rounded tabs
tabFolder.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
final Map<String, Map<String, List<Pref>>> prefs = GamaPreferences.organizePrefs();
for (final String tabName : prefs.keySet()) {
final CTabItem item = new CTabItem(tabFolder, SWT.NONE);
item.setFont(GamaFonts.getNavigHeaderFont());
item.setText(tabName);
item.setImage(prefs_images.get(tabName));
item.setShowClose(false);
buildContentsFor(item, prefs.get(tabName));
}
buildButtons();
shell.layout();
}
示例5: addApplication
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void addApplication(int index, final IWorkbenchApplication app) {
if (index < 0) {
index = 0;
}
else if (index > tabFolder.getItemCount()) {
index = tabFolder.getItemCount();
}
final CTabItem tabItem = new CTabItem(tabFolder, SWT.NONE, index);
tabItem.setText(app.getLabel());
tabItem.setImage(ImageHelper.getImage(
app.getIcon(),
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT)));
tabItem.setToolTipText(app.getTooltip());
final WorkbenchApplicationTree appTree = new WorkbenchApplicationTree(tabFolder, app, this);
final WorkbenchApplicationContext context = new WorkbenchApplicationContext(workbenchContext, app, appTree);
tabItem.setControl(appTree);
tabItem.setData(app);
tabItem.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent e) {
app.onDispose();
}
});
app.onContextInitialize(context);
}
示例6: createNewSearchTab
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void createNewSearchTab(BTSQueryRequest query, String queryName) {
// create main tab item
CTabItem searchTab = new CTabItem(tabFolder, SWT.NONE);
searchTab.setShowClose(true);
searchTab.setImage(resourceProvider.getImage(Display.getCurrent(), BTSResourceProvider.IMG_SEARCH));
if (queryName != null && queryName.trim().length() > 0)
{
searchTab.setText(queryName);
}
else
{
searchTab.setText(new Integer(tabFolder.getChildren().length - 2).toString());
}
searchTab.setData("key", query.getQueryId());
Composite searchTabItemComp = new Composite(tabFolder, SWT.NONE);
searchTabItemComp.setLayoutData(new GridData(GridData.FILL_BOTH));
searchTabItemComp.setLayout(new GridLayout());
((GridLayout) searchTabItemComp.getLayout()).marginHeight = 0;
((GridLayout) searchTabItemComp.getLayout()).marginWidth = 0;
searchTab.setControl(searchTabItemComp);
TreeViewer searchTreeViewer = new TreeViewer(searchTabItemComp);
searchTreeViewer.getTree()
.setLayoutData(new GridData(GridData.FILL_BOTH));
searchTreeViewer.getTree().setLayout(new GridLayout());
searchTab.setData("tv", searchTreeViewer);
searchTabItemComp.layout();
tabFolder.setSelection(searchTab);
TreeNodeWrapper searchRootNode = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
prepareTreeViewer(searchTreeViewer, searchTabItemComp);
// search
searchInput(searchTabItemComp, searchTreeViewer, searchRootNode, query, searchTab);
}
示例7: showLogTab
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void showLogTab(String name) {
CTabItem tabItemLog = new CTabItem(tabLogFolder, SWT.NONE);
tabItemLog.setText(name);
tabItemLog.setImage(new Image(display, ClassLoader
.getSystemResourceAsStream("icons/log.png")));
//add contorl
listViewerLog = new ListViewer(tabLogFolder, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
| SWT.H_SCROLL);
tabItemLog.setControl(listViewerLog.getList());
listViewerLog.getList().setFont(new Font(display, "宋體", 10, SWT.NONE));
//set content provider
listViewerLog.setContentProvider(new IStructuredContentProvider() {
public Object[] getElements(Object inputElement) {
Vector v = (Vector) inputElement;
return v.toArray();
}
public void dispose() {
}
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
});
listViewerLog.setInput(vectorLog);
}
示例8: addMachineTab
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void addMachineTab(final String name) {
final CTabItem tabItem = new CTabItem(tabHandsetName, SWT.MULTI | SWT.V_SCROLL);
tabItem.setImage(new Image(display, ClassLoader
.getSystemResourceAsStream("icons/device.png")));
tabItem.setText(name);
listHandsets = new List(tabHandsetName, SWT.BORDER);
tabItem.setControl(listHandsets);
listHandsets.setFont(new Font(display, "宋體", 10, SWT.NONE));
listHandsets.addListener(SWT.MenuDetect, new Listener() {
public void handleEvent(Event event) {
if (event.detail == 0) {
//select handset
if (listHandsets.getSelectionIndex() >= 0) {
device = findDevices.getDevices()[listHandsets.getSelectionIndex()];
//get device node from tree
listHandsets.setMenu(null);
createHandsetRightClickRecord();
listHandsets.setMenu(handsetMenu);
}
}
}
});
//show it
tabHandsetName.setSelection(tabItem);
}
示例9: addEmulator
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void addEmulator() {
final CTabItem tabItemEmulator = new CTabItem(tabProgress, SWT.V_SCROLL | SWT.H_SCROLL);
tabItemEmulator.setText("手機視圖");
tabItemEmulator.setImage(new Image(display, ClassLoader
.getSystemResourceAsStream("icons/view.png")));
addDisplay(tabItemEmulator);
//show it
tabProgress.setSelection(tabItemEmulator);
}
示例10: addRemoteHandsetsList
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private static void addRemoteHandsetsList() {
final CTabItem cloudHandsetsTabItem = new CTabItem(tabHandsetName, SWT.V_SCROLL
| SWT.H_SCROLL);
cloudHandsetsTabItem.setText("雲端設備");
cloudHandsetsTabItem.setImage(new Image(display, ".\\icons\\view.png"));
cloudHandsetsList = new List(tabHandsetName, SWT.BORDER);
cloudHandsetsTabItem.setControl(cloudHandsetsList);
cloudHandsetsList.setFont(new Font(display, "宋體", 10, SWT.NONE));
//show it
}
示例11: createTab
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
/**
* Create a tab for a contributor
*
* @param provider a contributor
*/
private void createTab(TemplateViewProvider provider){
CTabItem tableItem = new CTabItem(folder, SWT.NONE);
tableItem.setText(provider.getTabName());
tableItem.setImage(provider.getTabImage());
Composite tableComposite = new Composite(folder, SWT.NONE);
tableComposite.setLayout(new GridLayout(1,false));
provider.createControls(tableComposite);
tableItem.setControl(tableComposite);
}
示例12: addFolderItem
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
public void addFolderItem(String title, Image img, AbstractTabComposite content) {
CTabItem itm = new CTabItem(tabs, SWT.NONE);
content.setTab(itm);
if (img != null) {
itm.setImage(img);
}
Application.setTabLabel(itm, title);
itm.setControl(content);
this.application.getFolderMonitor().registerTabItem(itm);
}
示例13: createNewSearchTab
import org.eclipse.swt.custom.CTabItem; //導入方法依賴的package包/類
private void createNewSearchTab(BTSQueryRequest query, String queryName, List<BTSCorpusObject> objects) {
// create main tab item
CTabItem searchTab = new CTabItem(tabFolder, SWT.NONE);
searchTab.setShowClose(true);
searchTab.setImage(resourceProvider.getImage(Display.getCurrent(), BTSResourceProvider.IMG_SEARCH));
if (queryName != null && queryName.trim().length() > 0)
{
searchTab.setText(queryName);
}
else
{
searchTab.setText(new Integer(tabFolder.getChildren().length - 2).toString());
}
if (query != null)
{
searchTab.setData("key", query.getQueryId());
}
Composite searchTabItemComp = new Composite(tabFolder, SWT.NONE);
searchTabItemComp.setLayoutData(new GridData(GridData.FILL_BOTH));
searchTabItemComp.setLayout(new GridLayout());
((GridLayout) searchTabItemComp.getLayout()).marginHeight = 0;
((GridLayout) searchTabItemComp.getLayout()).marginWidth = 0;
searchTab.setControl(searchTabItemComp);
TreeViewer searchTreeViewer = new TreeViewer(searchTabItemComp);
searchTreeViewer.getTree()
.setLayoutData(new GridData(GridData.FILL_BOTH));
searchTreeViewer.getTree().setLayout(new GridLayout());
searchTab.setData("tv", searchTreeViewer);
searchTabItemComp.layout();
tabFolder.setSelection(searchTab);
TreeNodeWrapper searchRootNode = BtsviewmodelFactory.eINSTANCE.createTreeNodeWrapper();
prepareTreeViewer(searchTreeViewer, searchTabItemComp);
// search
searchInput(searchTabItemComp, searchTreeViewer, searchRootNode, query, objects, searchTab);
}