本文整理匯總了Java中org.eclipse.swt.custom.CTabItem類的典型用法代碼示例。如果您正苦於以下問題:Java CTabItem類的具體用法?Java CTabItem怎麽用?Java CTabItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CTabItem類屬於org.eclipse.swt.custom包,在下文中一共展示了CTabItem類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPartControl
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Create contents of the editor part.
* @param parent
*/
@Override
@PostConstruct
public void createPartControl(Composite parent) {
this.sashForm = new SashForm(parent, SWT.NONE);
this.treeViewer = new TreeViewer(this.sashForm, SWT.BORDER);
this.tree = this.treeViewer.getTree();
this.tabFolder = new CTabFolder(this.sashForm, SWT.BORDER);
this.tabFolder.setTabPosition(SWT.BOTTOM);
this.tabFolder.setSelectionBackground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND_GRADIENT));
this.tabItem = new CTabItem(this.tabFolder, SWT.NONE);
this.tabItem.setText("New Item");
this.tabItem_1 = new CTabItem(this.tabFolder, SWT.NONE);
this.tabItem_1.setText("New Item");
this.sashForm.setWeights(new int[] { 3, 10 });
}
示例2: createTabFolder
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
private void createTabFolder ( final Composite parent )
{
this.tabFolder = new CTabFolder ( parent, SWT.TOP );
this.tabFolder.setLayoutData ( new GridData ( GridData.FILL, GridData.FILL, true, true ) );
for ( final GeneratorPageInformation page : this.pages )
{
final CTabItem tabItem = new CTabItem ( this.tabFolder, SWT.NONE );
final Composite tabComposite = new Composite ( this.tabFolder, SWT.NONE );
tabComposite.setLayout ( new FillLayout () );
page.getGeneratorPage ().createPage ( tabComposite );
tabItem.setText ( page.getLabel () );
tabItem.setControl ( tabComposite );
page.getGeneratorPage ().setTarget ( this );
}
this.tabFolder.setSelection ( 0 );
}
示例3: show
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
@Override
protected void show ()
{
super.show ();
final int tabIndex = findIndex ( this.index );
if ( tabIndex < 0 )
{
this.item = new CTabItem ( this.folder, SWT.NONE );
this.item.setData ( "order", this.index );
}
else
{
this.item = new CTabItem ( this.folder, SWT.NONE, tabIndex );
this.item.setData ( "order", this.index );
}
this.item.setControl ( this.container );
useItem ( this.item );
}
示例4: DiskInfoTab
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Create the DISK INFO tab.
*/
public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) {
this.formattedDisks = disks;
CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL);
ctabitem.setText(textBundle.get("DiskInfoTab.Title")); //$NON-NLS-1$
tabFolder.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
getInfoTable().removeAll();
buildDiskInfoTable(getFormattedDisk(0)); // FIXME!
}
});
ScrolledComposite scrolledComposite = new ScrolledComposite(
tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
ctabitem.setControl(scrolledComposite);
composite = new Composite(scrolledComposite, SWT.NONE);
createDiskInfoTable();
if (disks.length > 1) {
RowLayout layout = new RowLayout(SWT.VERTICAL);
layout.wrap = false;
composite.setLayout(layout);
for (int i=0; i<disks.length; i++) {
Label label = new Label(composite, SWT.NULL);
label.setText(disks[i].getDiskName());
buildDiskInfoTable(disks[i]);
}
} else {
composite.setLayout(new FillLayout());
buildDiskInfoTable(disks[0]);
}
composite.pack();
scrolledComposite.setContent(composite);
scrolledComposite.setMinSize(
composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
示例5: 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());
}
}
}
}
示例6: createContents
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
@Override
protected Control createContents(Composite parent) {
Control control = super.createContents(parent);
boolean selected = false;
if (folder.getItemCount() > 0) {
if (lastSelectedTabId != null) {
CTabItem[] items = folder.getItems();
for (int i = 0; i < items.length; i++)
if (items[i].getData(ID).equals("30.PluginPage")) {
folder.setSelection(i);
tabSelected(items[i]);
selected = true;
break;
}
}
if (!selected)
tabSelected(folder.getItem(0));
}
// need to reapply the dialog font now that we've created new
// tab items
Dialog.applyDialogFont(folder);
return control;
}
示例7: setSwtItem
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
public void setSwtItem(CTabItem swtItem) {
this.swtItem = swtItem;
if (swtItem == null) {
setDisposed(true);
return;
}
setDisposed(false);
swtItem.addDisposeListener(this);
String title = getTitle();
if (title != null) {
swtItem.setText(escapeAccelerators(title));
}
updateLeftImage();
swtItem.setShowClose(isCloseable());
if (buildonSWTItemSet) {
build();
}
if (showonSWTItemSet) {
show();
}
}
示例8: addNewNote
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Adds a new note to the notepad.
*/
public void addNewNote() {
String noteText = "";
if (preferences.getBoolean(PreferenceConstants.PREF_PASTE_CLIPBOARD_IN_NEW_NOTES,
PreferenceConstants.PREF_PASTE_CLIPBOARD_IN_NEW_NOTES_DEFAULT)) {
noteText = (String) clipboard.getContents(TextTransfer.getInstance(), DND.CLIPBOARD);
}
String noteTitle = preferences.get(PreferenceConstants.PREF_NAME_PREFIX,
PreferenceConstants.PREF_NAME_PREFIX_DEFAULT) + " " + (tabFolder.getItemCount() + 1);
// Add a new note tab with a number appended to its name (Note 1, Note 2, Note 3, etc.).
addNewNoteTab(noteTitle, noteText, null, true, null);
CTabItem previousSelectedTab = tabFolder.getSelection();
// Remove lock for currently selected tab.
if (previousSelectedTab != null && previousSelectedTab.getText().startsWith(LOCK_PREFIX)) {
previousSelectedTab.setText(previousSelectedTab.getText().substring(LOCK_PREFIX.length()));
}
tabFolder.setSelection(tabFolder.getItemCount() - 1);
}
示例9: savePluginState
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Saves plugin state for next Eclipse session or when reopening the view.
*/
private void savePluginState() {
if (!tabFolder.isDisposed()) {
IDialogSettings section = Notepad4e.getDefault().getDialogSettings().getSection(ID);
section.put(STORE_COUNT_KEY, tabFolder.getItemCount());
for (int tabIndex = 0; tabIndex < tabFolder.getItemCount(); ++tabIndex) {
CTabItem tab = tabFolder.getItem(tabIndex);
if (!tab.isDisposed()) {
Note note = getNote(tabIndex);
section.put(STORE_TEXT_PREFIX_KEY + tabIndex, note.getText());
section.put(STORE_STYLE_PREFIX_KEY + tabIndex, note.serialiseStyle());
if (tab.getText().startsWith(LOCK_PREFIX)) {
// Do not save lock symbol.
section.put(STORE_TITLE_PREFIX_KEY + tabIndex, tab.getText().substring(LOCK_PREFIX.length()));
} else {
section.put(STORE_TITLE_PREFIX_KEY + tabIndex, tab.getText());
}
section.put(STORE_EDITABLE_PREFIX_KEY + tabIndex, note.getEditable());
section.put(STORE_BULLETS_PREFIX_KEY + tabIndex, note.serialiseBullets());
}
}
Notepad4e.save();
}
}
示例10: addNewNoteTab
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Adds a new note to the view.
*
* @param title
* @param text
* @param style
* @param editable
* @param noteBullets
*/
private void addNewNoteTab(String title, String text, String style, boolean editable, String bullets) {
CTabItem tab = new CTabItem(tabFolder, SWT.NONE);
tab.setText(title);
// Add listener to clean up corresponding note when disposing the tab.
tab.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
CTabItem itemToDispose = (CTabItem) event.getSource();
((Note) itemToDispose.getControl()).dispose();
}
});
Note note = new Note(tabFolder, text, editable);
// Style can be null if new note.
if (style != null && !style.isEmpty()) {
note.deserialiseStyle(style);
}
// Bullets can be null if new note or upgrading from old plugin version.
if (bullets != null && !bullets.isEmpty()) {
note.deserialiseBullets(bullets);
}
tab.setControl(note);
}
示例11: updateTabItems
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
public void updateTabItems() {
if(!this.isDisposed()) {
this.ignoreEvents = true;
this.disposeOrphanItems();
TGDocumentListManager documentManager = TGDocumentListManager.getInstance(this.context);
TGDocument currentDocument = documentManager.findCurrentDocument();
List<TGDocument> documents = documentManager.getDocuments();
for(int i = 0 ; i < documents.size() ; i ++) {
TGDocument document = documents.get(i);
CTabItem cTabItem = this.findTabItem(i);
cTabItem.setText(this.createTabItemLabel(document));
cTabItem.setData(document);
if( currentDocument != null && currentDocument.equals(document) ) {
this.tabFolder.setSelection(i);
}
}
this.currentUnsaved = currentDocument.isUnsaved();
this.ignoreEvents = false;
}
}
示例12: LayoutGeneral
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Creates the Complete General Tab
* @param parent The Parent Folder
* @param meta The Meta Include for this Project
* @param props The PropsUI from the Kettle Project
* @param fieldNames The FieldNames from the Previous Step
*/
public LayoutGeneral(final CTabFolder parent, ARXPluginMeta meta, final PropsUI props, String[] fieldNames) {
this.meta = meta;
this.props = props;
this.fieldNames = fieldNames;
composites = new LayoutCompositeInterface[2];
CTabItem tabGeneral = new CTabItem(parent, SWT.NONE);
tabGeneral.setText(Resources.getMessage("General.2"));
ScrolledComposite scroller = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
this.build(scroller);
tabGeneral.setControl(scroller);
{
}
}
示例13: showSettingsAttributeWeights
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
/**
* Shows the settings for the attribute weights.
*/
private void showSettingsAttributeWeights() {
if (this.cTabAttributeWeights != null && !this.attributeWeight.quasiIdentifierChanged())
return;
if (this.cTabAttributeWeights != null)
this.hideSettingsAttributeWeights();
this.cTabAttributeWeights = new CTabItem(wTabFolder, SWT.NONE);
this.cTabAttributeWeights.setText(Resources.getMessage("CriterionDefinitionView.63"));
Composite cTabAttributeWeightsComp = new Composite(this.wTabFolder, SWT.NONE);
props.setLook(cTabAttributeWeightsComp);
cTabAttributeWeightsComp.setLayout(new FillLayout());
cTabAttributeWeightsComp.setEnabled(true);
this.attributeWeight = new ViewAttributeWeights(cTabAttributeWeightsComp, meta, fieldNames);
this.composites[2] = this.attributeWeight;
cTabAttributeWeightsComp.layout();
cTabAttributeWeights.setControl(cTabAttributeWeightsComp);
}
示例14: updateSelectedOnTabFolder
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
void updateSelectedOnTabFolder(CTabFolder tf) {
if (tf == null)
return;
for (CTabItem i : tf.getItems()) {
if (i == tf.getSelection()) {
// Font f = Fonts.createFont(i.getFont().getFo, height, style);
i.setFont(Fonts.addStyleBit(i.getFont(), SWT.BOLD));
i.setFont(Fonts.removeStyleBit(i.getFont(), SWT.NORMAL));
} else {
i.setFont(Fonts.removeStyleBit(i.getFont(), SWT.BOLD));
i.setFont(Fonts.addStyleBit(i.getFont(), SWT.NORMAL));
}
}
}
示例15: createKwTab
import org.eclipse.swt.custom.CTabItem; //導入依賴的package包/類
private void createKwTab(TrpKeyWord k) {
CTabItem item = new CTabItem(folder, SWT.NONE);
item.setText("\"" + k.getKeyWord() + "\" (" + k.getHits().size() + " hits)");
Composite c = new Composite(folder, SWT.NONE);
c.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
c.setLayout(new GridLayout(1, false));
KwsHitTableWidget hitTableWidget = new KwsHitTableWidget(c, SWT.BORDER, icons);
hitTableWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
hitTableWidget.getTableViewer().setInput(k.getHits());
tvList.add(hitTableWidget.getTableViewer());
addHoverListeners(hitTableWidget.getTableViewer().getTable());
item.setControl(c);
addDoubleClickListener(hitTableWidget.getTableViewer());
}