Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 568659 - [Big Sur] in Swt widget table indexed based remove is not working in Big Sur Os
Summary: [Big Sur] in Swt widget table indexed based remove is not working in Big Sur Os
Status: CLOSED DUPLICATE of bug 567132
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.18   Edit
Hardware: PC Mac OS X
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 565691
  Show dependency tree
 
Reported: 2020-11-10 01:58 EST by shireesha k CLA
Modified: 2020-12-01 08:43 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shireesha k CLA 2020-11-10 01:58:36 EST
[Big Sur] in Swt widget table indexed based remove is not working in Big Sur Os
Comment 1 Lakshmi P Shanmugam CLA 2020-11-16 04:34:14 EST
Can you please provide a snippet to reproduce the problem?
Comment 2 shireesha k CLA 2020-11-23 03:52:24 EST
(In reply to Lakshmi P Shanmugam from comment #1)
> Can you please provide a snippet to reproduce the problem?

Please find the following base code.this is just example .

Steps to reproduce:

1.Run the code you will get Ui .
2.select any of the column and click add button.
3.you will be able to see the list in last table.
4.like this add multiple items to the added list.
5.From added list select any item click on remove.
u can see that still that item will be exist on added list.
same way you can click on remove all. 

sorry im using 3.115.0 version of swt.
this is how added in xml

<dependencies>
		<dependency>
			<groupId>org.eclipse.platform</groupId>
			<artifactId>org.eclipse.swt.cocoa.macosx.x86_64</artifactId>
			<version>3.115.0</version>
			<exclusions>
				<exclusion>
					<groupId>org.eclipse.platform</groupId>
					<artifactId>org.eclipse.swt.gtk.linux.aarch64</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.eclipse.platform</groupId>
					<artifactId>org.eclipse.swt</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.eclipse.platform</groupId>
					<artifactId>org.eclipse.swt.gtk.linux.arm</artifactId>
				</exclusion>
			</exclusions>
		</dependency>







import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;

public class SWTSnippet {

	static Shell s;
	static Table multiSelectTable;
	Table t;
	private static String selectedItem;
	
	public static void main(String[] argv) {
     	  		
		       Display d = new Display();
			     s = new Shell(d );

				s.setSize(250, 200);

				s.setText("A Table Shell Example");
				s.setLayout(new FillLayout());

				Table t = new Table(s, SWT.BORDER);

				TableColumn tc1 = new TableColumn(t, SWT.CENTER);
				tc1.setText("First Name");
				tc1.setWidth(70);
				t.setHeaderVisible(true);

				TableItem item1 = new TableItem(t, SWT.NONE);
				item1.setText(new String[] { "Tim" });
				TableItem item2 = new TableItem(t, SWT.NONE);
				item2.setText(new String[] { "Caitlyn"});
				TableItem item3 = new TableItem(t, SWT.NONE);
				item3.setText(new String[] { "Reese"});

				t.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						TableItem item = t.getItem(t.getSelectionIndex());
						selectedItem = item.getText();
					}
				});

				t.addMouseListener(new MouseListener() {
					@Override
					public void mouseDown(MouseEvent arg0) {
						// Do Nothing, Override Method
						if (t.getSelectionIndex() != -1) {
							TableItem item = t.getItem(t.getSelectionIndex());
							selectedItem = item.getText();
						}
					}

					@Override
					public void mouseUp(MouseEvent arg0) {
						// Do Nothing, Override Method
					}

					@Override
					public void mouseDoubleClick(MouseEvent event) {

					}

				});

				GridData saveGridData = new GridData();
				saveGridData.horizontalAlignment = GridData.CENTER;
				saveGridData.widthHint = 120;

				GridData contactGroupGridData = new GridData(GridData.FILL_HORIZONTAL);
				contactGroupGridData.horizontalSpan = 1;

				Button btnForAdd = new Button(s, SWT.PUSH | SWT.CENTER);
				btnForAdd.setText("ADD");
				btnForAdd.pack();
				btnForAdd.setLayoutData(saveGridData);
				btnForAdd.setAlignment(SWT.CENTER);
				btnForAdd.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						addRestoreItems();

					}

				});

				Button btnForRemove = new Button(s, SWT.PUSH | SWT.CENTER);
				btnForRemove.setText("REMOVE");
				btnForRemove.pack();
				btnForRemove.setLayoutData(saveGridData);
				btnForRemove.setAlignment(SWT.CENTER);
				btnForRemove.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						if (multiSelectTable.getSelectionIndex() != -1) {
							removeRestoreItems();
						}

					}

				});

				Button btnRemoveAll = new Button(s, SWT.PUSH | SWT.CENTER);
				btnRemoveAll.setText("REMOVE_ALL");
				btnRemoveAll.pack();
				btnRemoveAll.setLayoutData(saveGridData);
				btnRemoveAll.setAlignment(SWT.CENTER);
				btnRemoveAll.addSelectionListener(new SelectionAdapter() {
					@Override
					public void widgetSelected(SelectionEvent e) {
						multiSelectTable.removeAll();
					}

				});

				multiSelectTable = new Table(s, SWT.BORDER);
				TableColumn tc11 = new TableColumn(multiSelectTable, SWT.CENTER);
				tc11.setText("Added List");
				tc11.setWidth(70);
				multiSelectTable.setHeaderVisible(true);

				s.open();
				while (!s.isDisposed()) {
				      if (!d.readAndDispatch())
				        d.sleep();
				    }
				    d.dispose();
			
	}
	private static void addRestoreItems() {
		TableItem tableItem;
		tableItem = new TableItem(multiSelectTable, SWT.NONE);
		tableItem.setText(0, selectedItem);
		// tableItem.setData("........");
	}

	private static void removeRestoreItems() {
		multiSelectTable.remove(multiSelectTable.getSelectionIndex());

	}
}
Comment 3 Lakshmi P Shanmugam CLA 2020-11-23 18:18:56 EST
It's not reproducible with the latest milestone build - https://download.eclipse.org/eclipse/downloads/drops4/S-4.18M3-202011190730/

Looks like a refresh issue fixed by Bug 567132 changes.
Comment 4 Daniel Bogenrieder CLA 2020-11-24 03:22:52 EST
I am still experiencing the same problems as reported. Even with the eclipse version you have linked. I tried to code provided by shireesha k and when I delete an entry the table is not refreshed. (I am also on Big Sur)
Comment 5 shireesha k CLA 2020-11-24 05:06:45 EST
(In reply to Lakshmi P Shanmugam from comment #3)
> It's not reproducible with the latest milestone build -
> https://download.eclipse.org/eclipse/downloads/drops4/S-4.18M3-202011190730/
> 
> Looks like a refresh issue fixed by Bug 567132 changes.

I'm not understanding what is the solution.

if this bug is fixed can you please tell me the swt version.I'm using  3.115.0 version of swt.

this is my dependencies which i have used for swt, please check this still I'm able to see this issue on big sur


     <dependency>
           <groupId>org.eclipse.platform</groupId>
	    <artifactId>org.eclipse.swt.cocoa.macosx.x86_64</artifactId>
	     <version>3.115.0</version>
	<exclusions>
	  <exclusion>
	    <groupId>org.eclipse.platform</groupId>
		<artifactId>org.eclipse.swt.gtk.linux.aarch64</artifactId>
	  </exclusion>
	<exclusion>
	<groupId>org.eclipse.platform</groupId>
	  <artifactId>org.eclipse.swt</artifactId>
	  </exclusion>
	    <exclusion>
	     <groupId>org.eclipse.platform</groupId>
	         <artifactId>org.eclipse.swt.gtk.linux.arm</artifactId>
	     </exclusion>
	 </exclusions>
    </dependency>
Comment 6 Lakshmi P Shanmugam CLA 2020-11-24 06:11:20 EST
(In reply to shireesha k from comment #5)
> (In reply to Lakshmi P Shanmugam from comment #3)
> > It's not reproducible with the latest milestone build -
> > https://download.eclipse.org/eclipse/downloads/drops4/S-4.18M3-202011190730/
> > 
> > Looks like a refresh issue fixed by Bug 567132 changes.
> 
> I'm not understanding what is the solution.
> 
> if this bug is fixed can you please tell me the swt version.I'm using 
> 3.115.0 version of swt.
> 
Please try SWT version 3.115.100.
Comment 7 shireesha k CLA 2020-11-28 06:04:00 EST
(In reply to Lakshmi P Shanmugam from comment #6)
> (In reply to shireesha k from comment #5)
> > (In reply to Lakshmi P Shanmugam from comment #3)
> > > It's not reproducible with the latest milestone build -
> > > https://download.eclipse.org/eclipse/downloads/drops4/S-4.18M3-202011190730/
> > > 
> > > Looks like a refresh issue fixed by Bug 567132 changes.
> > 
> > I'm not understanding what is the solution.
> > 
> > if this bug is fixed can you please tell me the swt version.I'm using 
> > 3.115.0 version of swt.
> > 
> Please try SWT version 3.115.100.





I couldn't find SWT jar version 3.115.100.

can you please send me the link where i can get maven dependencies for SWT jar version 3.115.100
Comment 8 Lakshmi P Shanmugam CLA 2020-12-01 05:30:07 EST
(In reply to shireesha k from comment #7)
> 
> I couldn't find SWT jar version 3.115.100.
> 
> can you please send me the link where i can get maven dependencies for SWT
> jar version 3.115.100

The maven dependencies with version 3.115.100 will be available on Maven central when 4.18 is released (December 16).
Meanwhile, you can test your snippet with the Eclipse M3 or RC1 builds - https://download.eclipse.org/eclipse/downloads/drops4/S-4.18RC1-202011251800/
Comment 9 Sravan Kumar Lakkimsetti CLA 2020-12-01 07:53:55 EST
This is a refresh issue I am able to reproduce the issue with 4.17 eclipse and this problem is not reproducible in 4.18 I-build I20201130-1800
Comment 10 Lakshmi P Shanmugam CLA 2020-12-01 08:43:43 EST
> The maven dependencies with version 3.115.100 will be available on Maven
> central when 4.18 is released (December 16).
> Meanwhile, you can test your snippet with the Eclipse M3 or RC1 builds -
> https://download.eclipse.org/eclipse/downloads/drops4/S-4.18RC1-202011251800/

Thanks for testing, Sravan.

@Shireesha, Please reopen if problem still happens for you after testing with the above fixed versions.

*** This bug has been marked as a duplicate of bug 567132 ***