本文整理汇总了Java中org.eclipse.swt.widgets.TabItem.setImage方法的典型用法代码示例。如果您正苦于以下问题:Java TabItem.setImage方法的具体用法?Java TabItem.setImage怎么用?Java TabItem.setImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.TabItem
的用法示例。
在下文中一共展示了TabItem.setImage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTabFolder
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
private TabFolder createTabFolder( Composite parent )
{
tabFolder = new TabFolder( parent, SWT.NONE );
// Should not set layout for TabFolder.
// GridData gd = new GridData( GridData.FILL_BOTH );
// tabFolder.setLayoutData( gd );
// GridLayout layout = new GridLayout( );
// tabFolder.setLayout( layout );
rowArea = new TabItem( tabFolder, SWT.NONE );
rowArea.setText( Messages.getString( "AggregationDialog.TabItem.Title.RowArea" ) ); //$NON-NLS-1$
rowArea.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.ROWS_AREA_IMAGE ) );
columnArea = new TabItem( tabFolder, SWT.NONE );
columnArea.setText( Messages.getString( "AggregationDialog.TabItem.Title.ColumnArea" ) ); //$NON-NLS-1$
columnArea.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.COLUMNS_AREA_IMAGE ) );
return tabFolder;
}
示例2: TabMain
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
TabMain(TabMediator mediator) {
this.mediator = mediator;
TabItem tab = new TabItem(mediator.folder, SWT.NONE);
tab.setText("General");
tab.setToolTipText("General location parameters");
tab.setImage(circle);
tab.setControl(createControl(mediator.folder));
}
示例3: TabAdvanced
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
TabAdvanced(TabMediator mediator) {
this.mediator = mediator;
TabItem tab = new TabItem(mediator.folder, SWT.NONE);
tab.setText("Advanced parameters");
tab.setToolTipText("Access to advanced Hadoop parameters");
tab.setImage(circle);
tab.setControl(createControl(mediator.folder));
}
示例4: createDialogArea
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(final Composite parent) {
parent.setLayout(new GridLayout(1, false));
folder = new TabFolder(parent, SWT.NONE);
folder.setLayoutData(GridDataFactory.swtDefaults().grab(true, true).indent(0, 0).align(SWT.FILL, SWT.FILL).create());
// Build tabs
for (final String category : categories) {
// Create the tab folder
final TabItem tab = new TabItem(folder, SWT.NONE);
tab.setText(category);
if (images.get(category) != null) {
tab.setImage(images.get(category));
}
final Composite tabC = createCategory(folder, category, preferences.get(category));
tab.setControl(tabC);
}
// Ugly hack that seems to be needed to achieve a correct layout on Linux/GTK
folder.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent arg0) {
folder.layout(true, true);
folder.removePaintListener(this);
}
});
return parent;
}
示例5: validateSettings
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
private void validateSettings(TabItem tbtmSettings, String decompilerJarAbsoluteName) {
if (isPathToDecompilerValid(decompilerJarAbsoluteName)) {
tbtmSettings.setImage(SWTResourceManager.getImage(DecompileDialog.class, "/icons/hprio_tsk.gif"));
} else {
tbtmSettings.setImage(SWTResourceManager.getImage(DecompileDialog.class, "/icons/tasks_tsk.gif"));
}
}
示例6: createTreeLibsControlTab
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
/**
* Creates tab to show the pythonpath (libraries)
*/
private void createTreeLibsControlTab() {
Composite parent;
GridData gd;
TabItem tabItem = new TabItem(tabFolder, SWT.None);
tabItem.setText("Libraries");
tabItem.setImage(imageSystemLibRoot);
Composite composite = new Composite(tabFolder, SWT.None);
parent = composite;
composite.setLayout(new GridLayout(2, false));
Label l1 = new Label(parent, SWT.None);
l1.setText("System PYTHONPATH. Reorder with Drag && Drop.");
gd = new GridData();
gd.horizontalSpan = 2;
l1.setLayoutData(gd);
//the tree
treeWithLibs = getTreeLibsControl(parent);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 200;
treeWithLibs.setLayoutData(gd);
//buttons at the side of the tree
Composite control = getButtonBoxControlSystem(parent);
gd = new GridData();
gd.verticalAlignment = GridData.BEGINNING;
control.setLayoutData(gd);
tabItem.setControl(composite);
}
示例7: createPackageControlTab
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
/**
* @param exeOrJarOfInterpretersToRestore if the info is changed, the executable should be added to exeOrJarOfInterpretersToRestore.
*/
public void createPackageControlTab(TabFolder tabFolder, Set<String> exeOrJarOfInterpretersToRestore) {
Composite parent;
GridData gd;
TabItem tabItem = new TabItem(tabFolder, SWT.None);
tabItem.setText("Packages");
ImageCache imageCache = PydevPlugin.getImageCache();
tabItem.setImage(imageCache.get(UIConstants.FOLDER_PACKAGE_ICON));
Composite composite = new Composite(tabFolder, SWT.None);
parent = composite;
GridLayout layout = new GridLayout(2, false);
composite.setLayout(layout);
tree = new Tree(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
tree.setHeaderVisible(true);
createColumn("Library", 300);
createColumn("Version", 100);
createColumn("", 100);
gd = new GridData(GridData.FILL_BOTH);
gd.horizontalSpan = 1;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
tree.setLayoutData(gd);
//buttons at the side of the tree
Composite control = getButtonBoxPackage(parent);
gd = new GridData();
gd.verticalAlignment = GridData.BEGINNING;
control.setLayoutData(gd);
tabItem.setControl(composite);
}
示例8: createTabExternalSourceFolders
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
private void createTabExternalSourceFolders(String externalSourcePath) {
TabItem tabItem = new TabItem(tabFolder, SWT.None);
tabItem.setText("External Libraries");
Composite topComp = new Composite(tabFolder, SWT.None);
tabItem.setImage(PydevPlugin.getImageCache().get(UIConstants.LIB_SYSTEM));
topComp.setLayout(new GridLayout(1, false));
GridData gd;
GridData data;
Label l2;
l2 = new Label(topComp, SWT.None);
l2.setText("External libraries (source folders/zips/jars/eggs) outside of the workspace.\n\n"
+ "When using variables, the final paths resolved must be filesystem absolute.\n\n"
+ "Changes in external libraries are not monitored, so, the 'Force restore internal info'\ns"
+ "hould be used if an external library changes. ");
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = false;
l2.setLayoutData(gd);
treeExternalLibs = new TreeWithAddRemove(topComp, 0, PythonNature.getStrAsStrItems(externalSourcePath)) {
@Override
protected String getImageConstant() {
return UIConstants.LIB_SYSTEM;
}
@Override
protected String getButtonLabel(int i) {
switch (i) {
case 0:
return "Add source folder";
case 1:
return "Add zip/jar/egg";
case 2:
return "Add based on variable";
default:
throw new AssertionError("Unexpected: " + i);
}
}
@Override
protected void handleAddButtonSelected(int nButton) {
if (nButton == 0) {
addItemWithDialog(new DirectoryDialog(getShell()));
} else if (nButton == 1) {
addItemWithDialog(new FileDialog(getShell(), SWT.MULTI));
} else if (nButton == 2) {
addItemWithDialog(new InputDialog(getShell(), "Add path to resolve with variable",
"Add path to resolve with variable in the format: ${VARIABLE}", "", null));
} else {
throw new AssertionError("Unexpected");
}
}
};
data = new GridData(GridData.FILL_BOTH);
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
treeExternalLibs.setLayoutData(data);
tabItem.setControl(topComp);
}
示例9: createTabProjectSourceFolders
import org.eclipse.swt.widgets.TabItem; //导入方法依赖的package包/类
private void createTabProjectSourceFolders(String sourcePath) {
TabItem tabItem = new TabItem(tabFolder, SWT.None);
tabItem.setText("Source Folders");
tabItem.setImage(PydevPlugin.getImageCache().get(UIConstants.SOURCE_FOLDER_ICON));
Composite topComp = new Composite(tabFolder, SWT.None);
topComp.setLayout(new GridLayout(1, false));
GridData gd;
GridData data;
Label l2 = new Label(topComp, SWT.None);
l2.setText("Project Source Folders (and zips/jars/eggs).\n\n"
+ "When using variables, the final paths resolved must be workspace-relative.");
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = false;
l2.setLayoutData(gd);
treeSourceFolders = new TreeWithAddRemove(topComp, 0, PythonNature.getStrAsStrItems(sourcePath)) {
@Override
protected String getButtonLabel(int i) {
switch (i) {
case 0:
return "Add source folder";
case 1:
return "Add zip/jar/egg";
case 2:
return "Add based on variable";
default:
throw new AssertionError("Unexpected: " + i);
}
}
@Override
protected void handleAddButtonSelected(int nButton) {
if (nButton == 0) {
addItemWithDialog(new ProjectFolderSelectionDialog(getShell(), project, true,
"Choose source folders to add to PYTHONPATH"), project);
} else if (nButton == 1) {
addItemWithDialog(new ResourceSelectionDialog(getShell(), project,
"Choose zip/jar/egg to add to PYTHONPATH"), project);
} else if (nButton == 2) {
addItemWithDialog(new InputDialog(getShell(), "Add path to resolve with variable",
"Add path to resolve with variable in the format: ${VARIABLE}", "", null));
} else {
throw new AssertionError("Unexpected");
}
}
@Override
protected String getImageConstant() {
return UIConstants.SOURCE_FOLDER_ICON;
}
};
data = new GridData(GridData.FILL_BOTH);
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
treeSourceFolders.setLayoutData(data);
tabItem.setControl(topComp);
}