Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Multi Edit Caret Location(Caret Location for Multi Edit Dialog Box to be on Left)
Multi Edit Caret Location [message #1550996] Wed, 07 January 2015 10:46 Go to next message
ambuj bhargava is currently offline ambuj bhargavaFriend
Messages: 19
Registered: July 2014
Junior Member
Hi

Multi Edit Dialog Box that opens on F2 button presing has caret location in the middle.
Is there a way to bring it on left of the dialog.


Regards
Ambuj
Re: Multi Edit Caret Location [message #1551003 is a reply to message #1550996] Wed, 07 January 2015 10:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Yes, you are able to specify dialog settings via the EditConfigAttributes.EDIT_DIALOG_SETTINGS config attribute. You need to put a value to the dialog settings map for the key ICellEditDialog.DIALOG_SHELL_LOCATION.

An example is shown in the EditorExample.
Re: Multi Edit Caret Location [message #1551048 is a reply to message #1551003] Wed, 07 January 2015 11:29 Go to previous messageGo to next message
ambuj bhargava is currently offline ambuj bhargavaFriend
Messages: 19
Registered: July 2014
Junior Member
Hi Dirk

Thanks for the prompt reply.

.DIALOG_SHELL_LOCATION will specify the location of the Multi Edit Dialog
What I need is the location of the cursor inside the dialog, so that when ever the user enters the value it must begin from left not from the center
I guess you were talking about the below code

//configure custom dialog settings

Display display = Display.getCurrent();
Map editDialogSettings = new HashMap();
editDialogSettings.put(CellEditDialog.DIALOG_SHELL_TITLE, "My custom value");
editDialogSettings.put(CellEditDialog.DIALOG_SHELL_ICON, display.getSystemImage(SWT.ICON_WARNING));
editDialogSettings.put(CellEditDialog.DIALOG_SHELL_RESIZABLE, Boolean.TRUE);

Point size = new Point(400, 300);
editDialogSettings.put(CellEditDialog.DIALOG_SHELL_SIZE, size);
int screenWidth = display.getBounds().width;
int screenHeight = display.getBounds().height;
Point location = new Point((screenWidth / (2 * display.getMonitors ().length)) - (size.x/2), (screenHeight / 2) - (size.y/2));
editDialogSettings.put(CellEditDialog.DIALOG_SHELL_LOCATION, location
);


Can you please suggest.

ATTACHING THE SCREEN SHOT

Regards
Ambuj
  • Attachment: image5.jpg
    (Size: 339.01KB, Downloaded 121 times)

[Updated on: Wed, 07 January 2015 11:43]

Report message to a moderator

Re: Multi Edit Caret Location [message #1551068 is a reply to message #1551048] Wed, 07 January 2015 11:45 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
That is part of your style configuration. I assume you are also showing the cell value centered and not left aligned. Try to register a different HorizontalAlignmentEnum for DisplayMode.EDIT
Re: Multi Edit Caret Location [message #1551089 is a reply to message #1551068] Wed, 07 January 2015 11:55 Go to previous message
ambuj bhargava is currently offline ambuj bhargavaFriend
Messages: 19
Registered: July 2014
Junior Member
Thank you Dirk
It is working as per my need.

Thanks for your prompt help.


Regards
Ambuj Very Happy

[Updated on: Wed, 07 January 2015 11:57]

Report message to a moderator

Previous Topic:NAT TABLE UNDER SWT EXPANDABLE/COLLAPSED SECTION
Next Topic:is it dangerous to replace java.util.ArrayList by ca.odell.glazedlists.FilterList ?
Goto Forum:
  


Current Time: Wed Apr 24 22:28:09 GMT 2024

Powered by FUDForum. Page generated in 0.03515 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top