Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 215064 Details for
Bug 377746
[Table] Data does not show up intermittently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Group Tab to be used in the demo project to reproduce the issue
GroupTab.java (text/x-java-source), 4.00 KB, created by
Amandeep Chahal
on 2012-05-04 10:37:11 EDT
(
hide
)
Description:
Group Tab to be used in the demo project to reproduce the issue
Filename:
MIME Type:
Creator:
Amandeep Chahal
Created:
2012-05-04 10:37:11 EDT
Size:
4.00 KB
patch
obsolete
>/******************************************************************************* > * Copyright (c) 2007, 2008 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation > ******************************************************************************/ > >package org.eclipse.rap.demo.controls; > >import org.eclipse.rwt.RWT; >import org.eclipse.rwt.graphics.Graphics; >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.CTabFolder; >import org.eclipse.swt.events.SelectionAdapter; >import org.eclipse.swt.events.SelectionEvent; >import org.eclipse.swt.events.SelectionListener; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.layout.RowLayout; >import org.eclipse.swt.widgets.Button; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.swt.widgets.Group; >import org.eclipse.swt.widgets.Table; >import org.eclipse.swt.widgets.TableColumn; >import org.eclipse.swt.widgets.TableItem; > >public class GroupTab extends ExampleTab { > > private Group group; > > private Table table; > > private Button removeData; > > private Button showData; > > public GroupTab(final CTabFolder folder) { > super(folder, "Group"); > } > > protected void createStyleControls(Composite top) { > createStyleButton("BORDER", SWT.BORDER); > createVisibilityButton(); > createEnablementButton(); > createFgColorButton(); > createBgColorButton(); > createBgImageButton(); > createFontChooser(); > createToggleButtons(); > } > > private void createToggleButtons() { > showData = new Button( styleComp, SWT.PUSH ); > showData.setText("Show data"); > showData.addSelectionListener( new SelectionAdapter() { > @Override > public void widgetSelected( final SelectionEvent event ) { > createTable(true); > } > } ); > > removeData = new Button(styleComp, SWT.NONE); > removeData.setText("Remove data"); > removeData.addSelectionListener(new SelectionListener() { > > public void widgetSelected(SelectionEvent e) { > createTable(false); > } > > public void widgetDefaultSelected(SelectionEvent e) { > > } > }); > > if (table == null) { > table = new Table(group, SWT.VIRTUAL); > for (int i = 0; i < 8; i++) { > final TableColumn column = new TableColumn(table, SWT.NONE); > column.setText("Col " + i); > column.setWidth(i == 0 ? 50 : 40); > table.setHeaderVisible(true); > table.setLinesVisible(true); > table.setSelection(0); > table.setVisible(true); > table.setData(RWT.MARKUP_ENABLED, Boolean.TRUE); > } > } > > } > > protected void createExampleControls(final Composite parent) { > parent.setLayout(new FillLayout()); > group = new Group(parent, getStyle()); > group.setLayout(new RowLayout()); > group.setText("A group with one white label"); > // Label content = new Label( group, SWT.NONE ); > // content.setText( "Hello from inside the group box..." ); > // Color white = content.getDisplay().getSystemColor( SWT.COLOR_WHITE ); > // content.setBackground( white ); > registerControl(group); > } > > private void createTable(boolean createItems) { > if(createItems){ > table.removeAll(); > for (int i = 0; i < 20; i++) { > addItem(table,true); > } > } > else{ > for (int i = 0; i < 20; i++) { > updateItem(table.getItem(i),false); > } > } > table.setSize(300, 300) ; > } > > private TableItem addItem(Table table, boolean flag) { > TableItem result = new TableItem(table, SWT.NONE); > updateItem(result,flag); > return result; > } > > private void updateItem(final TableItem item,boolean flag) { > int index = item.getParent().indexOf(item); > for (int i = 0; i < 8; i++) { > if(flag){ > item.setText(i, "Item" + index + "-" + i); > item.setBackground(i, fgColors[1]); > item.setForeground(Graphics.getColor(255, 255, 255)); > } > else { > item.setText(i,""); > item.setBackground(i,null); > item.setForeground(i,null); > } > } > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 377746
:
215046
| 215064