2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.ui
.dialog
;
12 import java
.io
.IOException
;
13 import java
.text
.SimpleDateFormat
;
14 import java
.util
.Date
;
15 import java
.util
.HashMap
;
16 import java
.util
.List
;
19 import org
.apache
.commons
.lang
.StringUtils
;
20 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
21 import org
.eclipse
.core
.runtime
.IStatus
;
22 import org
.eclipse
.core
.runtime
.Status
;
23 import org
.eclipse
.core
.runtime
.jobs
.Job
;
24 import org
.eclipse
.core
.runtime
.preferences
.ConfigurationScope
;
25 import org
.eclipse
.core
.runtime
.preferences
.IEclipsePreferences
;
26 import org
.eclipse
.jface
.layout
.GridDataFactory
;
27 import org
.eclipse
.swt
.SWT
;
28 import org
.eclipse
.swt
.SWTException
;
29 import org
.eclipse
.swt
.custom
.StyledText
;
30 import org
.eclipse
.swt
.events
.KeyAdapter
;
31 import org
.eclipse
.swt
.events
.KeyEvent
;
32 import org
.eclipse
.swt
.events
.MouseAdapter
;
33 import org
.eclipse
.swt
.events
.MouseEvent
;
34 import org
.eclipse
.swt
.events
.SelectionAdapter
;
35 import org
.eclipse
.swt
.events
.SelectionEvent
;
36 import org
.eclipse
.swt
.graphics
.Point
;
37 import org
.eclipse
.swt
.layout
.FillLayout
;
38 import org
.eclipse
.swt
.layout
.GridData
;
39 import org
.eclipse
.swt
.layout
.GridLayout
;
40 import org
.eclipse
.swt
.widgets
.Button
;
41 import org
.eclipse
.swt
.widgets
.Combo
;
42 import org
.eclipse
.swt
.widgets
.Composite
;
43 import org
.eclipse
.swt
.widgets
.Dialog
;
44 import org
.eclipse
.swt
.widgets
.Display
;
45 import org
.eclipse
.swt
.widgets
.Label
;
46 import org
.eclipse
.swt
.widgets
.Shell
;
47 import org
.eclipse
.swt
.widgets
.Text
;
48 import org
.eclipse
.ui
.forms
.events
.ExpansionEvent
;
49 import org
.eclipse
.ui
.forms
.events
.IExpansionListener
;
50 import org
.eclipse
.ui
.forms
.widgets
.ExpandableComposite
;
51 import org
.eclipse
.ui
.progress
.IProgressConstants
;
52 import org
.eclipse
.wb
.swt
.SWTResourceManager
;
53 import org
.osgi
.service
.prefs
.BackingStoreException
;
54 import org
.osgi
.service
.prefs
.Preferences
;
55 import org
.springframework
.security
.authentication
.BadCredentialsException
;
56 import org
.springframework
.security
.authentication
.LockedException
;
57 import org
.springframework
.security
.authentication
.UsernamePasswordAuthenticationToken
;
59 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationRemoteConfiguration
;
60 import eu
.etaxonomy
.cdm
.api
.application
.CdmApplicationState
;
61 import eu
.etaxonomy
.cdm
.api
.service
.IUserService
;
62 import eu
.etaxonomy
.cdm
.model
.metadata
.CdmMetaData
;
63 import eu
.etaxonomy
.taxeditor
.l10n
.Messages
;
64 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
65 import eu
.etaxonomy
.taxeditor
.preference
.IPreferenceKeys
;
66 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
67 import eu
.etaxonomy
.taxeditor
.remoting
.server
.CDMServerException
;
68 import eu
.etaxonomy
.taxeditor
.remoting
.server
.CDMServerUtils
;
69 import eu
.etaxonomy
.taxeditor
.remoting
.source
.CdmRemoteSource
;
70 import eu
.etaxonomy
.taxeditor
.remoting
.source
.CdmServerInfo
;
71 import eu
.etaxonomy
.taxeditor
.remoting
.source
.CdmServerInfo
.CdmInstanceInfo
;
72 import eu
.etaxonomy
.taxeditor
.remoting
.source
.ICdmRemoteSource
;
73 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
74 import eu
.etaxonomy
.taxeditor
.store
.LoginManager
;
75 import eu
.etaxonomy
.taxeditor
.store
.internal
.TaxeditorStorePlugin
;
76 import eu
.etaxonomy
.taxeditor
.webapp
.CDMEmbeddedServerException
;
77 import eu
.etaxonomy
.taxeditor
.webapp
.CDMServer
;
78 import eu
.etaxonomy
.taxeditor
.webapp
.ICDMServerError
;
86 public class RemotingLoginDialog
extends Dialog
implements ICDMServerError
{
91 private static final String DEFAULT_PASS
= "00000";
95 private static final String DEFAULT_USER
= "admin";
96 private static final String UBUNTU
= "Ubuntu"; //$NON-NLS-1$
97 protected Object result
;
98 protected Shell shlConnect
;
99 private Text txtCdmServerStatus
;
100 private Text txtCdmInstanceStatus
;
101 private Combo comboCdmServer
;
102 private Combo comboCdmInstance
;
103 private Button btnConnect
;
105 private final Map
<String
, CdmServerInfo
> csiiMap
= new HashMap
<String
, CdmServerInfo
>();
107 private final static String STATUS_AVAILABLE
= Messages
.RemotingLoginDialog_STATUS_AVAILABLE
;
108 private final static String STATUS_NOT_AVAILABLE
= Messages
.RemotingLoginDialog_STATUS_NOT_AVAILABLE
;
109 private final static String STATUS_STARTED
= Messages
.RemotingLoginDialog_STATUS_STARTED
;
110 private final static String STATUS_NOT_STARTED
= Messages
.RemotingLoginDialog_STATUS_NOT_STARTED
;
111 private final static String STATUS_RETRIEVING
= Messages
.RemotingLoginDialog_STATUS_RETRIEVING
;
112 private final static String STATUS_CHECKING_AVAILABILITY
= Messages
.RemotingLoginDialog_STATUS_CHECKING
;
113 private final static String STATUS_NO_INSTANCES
= Messages
.RemotingLoginDialog_STATUS_NO_INSTANCES_FOUND
;
114 private final static String STATUS_NOT_COMPATIBLE
= Messages
.RemotingLoginDialog_STATUS_NOT_COMPATIBLE
;
116 private final static String MESG_COMPATIBLE_EDITOR_OLD
= Messages
.RemotingLoginDialog_UPDATE_EDITOR
;
117 private final static String MESG_COMPATIBLE_SERVER_OLD
= Messages
.RemotingLoginDialog_CHOOSE_COMPATIBLE_CDM_SERVER
;
119 private final static String STORE_PREFERENCES_NODE
= "eu.etaxonomy.taxeditor.store"; //$NON-NLS-1$
121 private final static String LOGIN_NODE
= "login"; //$NON-NLS-1$
122 private final static String USERNAME_SUFFIX
= "_username"; //$NON-NLS-1$
123 private final static String PASSWORD_SUFFIX
= "_password"; //$NON-NLS-1$
125 private final static String LAST_SERVER_INSTANCE_NODE
= "lastServerInstance"; //$NON-NLS-1$
126 private final static String LAST_SERVER_KEY
= "lastServerKey"; //$NON-NLS-1$
127 private final static String LAST_INSTANCE_KEY
= "lastInstanceKey"; //$NON-NLS-1$
130 private Composite remotingComposite
;
131 private CdmServerInfo selectedCsii
;
132 private CdmInstanceInfo selectedCdmInstance
;
133 private Button btnCdmServerRefresh
;
134 private Button btnCdmInstanceRefresh
;
135 private Button btnStopServer
;
136 private Composite loginComposite
;
137 private Label lblLogin
;
138 private Text txtLogin
;
139 private Label lblPassword
;
140 private Text txtPassword
;
141 private Button btnRememberMe
;
142 private Composite compAdvanced
;
143 private Label lblPort
;
144 private Text txtPort
;
145 private Label lblServerVersion
;
146 private Text txtServerVersion
;
147 private ExpandableComposite xpndblcmpstAdvanced
;
148 private StyledText styledTxtMessage
;
151 private final int MIN_WIDTH
= 530;
152 private final int MIN_HEIGHT
= 220;
153 private final int MIN_EXP_HEIGHT
= 380;
154 private final int MESSAGE_HEIGHT
= 25;
155 private Label lblEditorVersion
;
156 private Text txtEditorVersion
;
157 private Label lblServerCDMVersion
;
158 private Text txtServerCDMVersion
;
159 private Label lblEditorCDMVersion
;
160 private Text txtEditorCDMVersion
;
162 private String serverName
, instanceName
;
163 private boolean autoConnect
= false;
164 private boolean loadLoginPrefs
= true;
165 private boolean isDevRemoteSource
= false;
166 private Job serverJob
;
172 public RemotingLoginDialog(Shell parent
, int style
) {
173 super(parent
, style
);
174 setText(Messages
.RemotingLoginDialog_LABEL_LOGIN
);
177 public Object
open(CdmRemoteSource source
, boolean loadLoginPrefs
, boolean autoConnect
) {
178 this.loadLoginPrefs
= loadLoginPrefs
;
179 this.serverName
= source
.getName();
180 String contextPath
= source
.getContextPath();
181 this.instanceName
= contextPath
.substring(contextPath
.lastIndexOf("/") + 1); //$NON-NLS-1$
182 return open(serverName
, instanceName
, loadLoginPrefs
, autoConnect
);
186 public Object
open(String serverName
, String instanceName
, boolean loadLoginPrefs
, boolean autoConnect
) {
187 this.serverName
= serverName
;
188 this.instanceName
= instanceName
;
189 this.loadLoginPrefs
= loadLoginPrefs
;
190 this.autoConnect
= autoConnect
;
198 public Object
open() {
201 if(serverName
== null && instanceName
== null) {
202 readPrefLastServerInstance();
206 populateCdmServerCombo();
210 xpndblcmpstAdvanced
.setExpanded(false);
212 Display display
= getParent().getDisplay();
214 while (!shlConnect
.isDisposed()) {
215 if (!display
.readAndDispatch()) {
224 * Create contents of the dialog.
226 private void createContents() {
227 shlConnect
= new Shell(getParent(), SWT
.DIALOG_TRIM
);
228 shlConnect
.setMinimumSize(new Point(MIN_WIDTH
, MIN_HEIGHT
));
229 shlConnect
.setSize(MIN_WIDTH
, MIN_HEIGHT
);
230 shlConnect
.setText(Messages
.RemotingLoginDialog_LABEL_CONNECT
);
231 shlConnect
.setLayout(new FillLayout(SWT
.HORIZONTAL
));
233 remotingComposite
= new Composite(shlConnect
, SWT
.NONE
);
234 remotingComposite
.setLayout(new GridLayout(1, false));
236 Composite cdmServerComposite
= new Composite(remotingComposite
, SWT
.NONE
);
237 GridData gd_cdmServerComposite
= new GridData(SWT
.LEFT
, SWT
.CENTER
, false, false, 1, 1);
238 gd_cdmServerComposite
.heightHint
= 68;
239 cdmServerComposite
.setLayoutData(gd_cdmServerComposite
);
240 cdmServerComposite
.setLayout(new GridLayout(4, false));
242 Label lblCdmServer
= new Label(cdmServerComposite
, SWT
.NONE
);
243 lblCdmServer
.setText(Messages
.RemotingLoginDialog_LABEL_CDM_SERVER
);
244 lblCdmServer
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
245 lblCdmServer
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
247 comboCdmServer
= new Combo(cdmServerComposite
, SWT
.READ_ONLY
);
248 comboCdmServer
.addSelectionListener(new SelectionAdapter() {
250 public void widgetSelected(SelectionEvent e
) {
255 GridData gd_comboCdmServer
= new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 1, 1);
256 gd_comboCdmServer
.widthHint
= 150;
257 comboCdmServer
.setLayoutData(gd_comboCdmServer
);
258 comboCdmServer
.select(0);
260 txtCdmServerStatus
= new Text(cdmServerComposite
, SWT
.BORDER
);
261 txtCdmServerStatus
.setBackground(SWTResourceManager
.getColor(SWT
.COLOR_INFO_BACKGROUND
));
262 txtCdmServerStatus
.setEditable(false);
263 GridData gd_txtCdmServerStatus
= new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1);
264 gd_txtCdmServerStatus
.widthHint
= 100;
265 txtCdmServerStatus
.setLayoutData(gd_txtCdmServerStatus
);
267 btnCdmServerRefresh
= new Button(cdmServerComposite
, SWT
.NONE
);
268 btnCdmServerRefresh
.addSelectionListener(new SelectionAdapter() {
270 public void widgetSelected(SelectionEvent e
) {
274 btnCdmServerRefresh
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, false, false, 1, 1));
275 btnCdmServerRefresh
.setText(Messages
.RemotingLoginDialog_LABEL_REFRESH
);
277 Label lblCdmInstance
= new Label(cdmServerComposite
, SWT
.NONE
);
278 GridData gd_lblCdmInstance
= new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1);
279 gd_lblCdmInstance
.heightHint
= 30;
280 lblCdmInstance
.setLayoutData(gd_lblCdmInstance
);
281 lblCdmInstance
.setText(Messages
.RemotingLoginDialog_LABEL_CDM_INSTANCE
);
282 lblCdmInstance
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
284 comboCdmInstance
= new Combo(cdmServerComposite
, SWT
.READ_ONLY
);
285 comboCdmInstance
.addSelectionListener(new SelectionAdapter() {
287 public void widgetSelected(SelectionEvent e
) {
288 refreshCdmInstance();
291 GridData gd_comboCdmInstance
= new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 1, 1);
292 gd_comboCdmInstance
.widthHint
= 150;
293 comboCdmInstance
.setLayoutData(gd_comboCdmInstance
);
294 comboCdmInstance
.select(0);
296 txtCdmInstanceStatus
= new Text(cdmServerComposite
, SWT
.BORDER
);
297 txtCdmInstanceStatus
.setBackground(SWTResourceManager
.getColor(SWT
.COLOR_INFO_BACKGROUND
));
298 txtCdmInstanceStatus
.setEditable(false);
299 GridData gd_txtCdmInstanceStatus
= new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1);
300 gd_txtCdmInstanceStatus
.widthHint
= 100;
301 txtCdmInstanceStatus
.setLayoutData(gd_txtCdmInstanceStatus
);
303 btnCdmInstanceRefresh
= new Button(cdmServerComposite
, SWT
.FLAT
);
304 btnCdmInstanceRefresh
.addSelectionListener(new SelectionAdapter() {
306 public void widgetSelected(SelectionEvent e
) {
307 refreshCdmInstance();
310 GridData gd_btnCdmInstanceRefresh
= new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1);
311 gd_btnCdmInstanceRefresh
.widthHint
= 110;
312 gd_btnCdmInstanceRefresh
.heightHint
= 30;
313 btnCdmInstanceRefresh
.setLayoutData(gd_btnCdmInstanceRefresh
);
314 btnCdmInstanceRefresh
.setText(Messages
.RemotingLoginDialog_LABEL_REFRESH
);
316 loginComposite
= new Composite(remotingComposite
, SWT
.NONE
);
317 GridData gd_loginComposite
= new GridData(SWT
.LEFT
, SWT
.CENTER
, false, false, 1, 1);
318 gd_loginComposite
.widthHint
= 487;
319 gd_loginComposite
.heightHint
= 70;
320 loginComposite
.setLayoutData(gd_loginComposite
);
321 GridLayout gl_loginComposite
= new GridLayout(6, false);
322 gl_loginComposite
.marginTop
= 5;
323 loginComposite
.setLayout(gl_loginComposite
);
325 lblLogin
= new Label(loginComposite
, SWT
.CENTER
);
326 GridData gd_lblLogin
= new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1);
327 gd_lblLogin
.widthHint
= 50;
328 lblLogin
.setLayoutData(gd_lblLogin
);
329 lblLogin
.setText(Messages
.RemotingLoginDialog_LABEL_LOGIN_COLON
);
330 lblLogin
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
332 txtLogin
= new Text(loginComposite
, SWT
.BORDER
);
333 GridData gd_txtLogin
= new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 1, 1);
334 gd_txtLogin
.minimumWidth
= 80;
335 gd_txtLogin
.widthHint
= 80;
336 gd_txtLogin
.heightHint
= 15;
337 txtLogin
.setLayoutData(gd_txtLogin
);
339 lblPassword
= new Label(loginComposite
, SWT
.CENTER
);
340 lblPassword
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
341 lblPassword
.setText(Messages
.RemotingLoginDialog_LABEL_PASSWORD
);
342 lblPassword
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
344 txtPassword
= new Text(loginComposite
, SWT
.BORDER
| SWT
.PASSWORD
);
345 GridData gd_txtPassword
= new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 1, 1);
346 gd_txtPassword
.minimumWidth
= 80;
347 gd_txtPassword
.widthHint
= 80;
348 gd_txtPassword
.heightHint
= 15;
349 txtPassword
.setLayoutData(gd_txtPassword
);
350 new Label(loginComposite
, SWT
.NONE
);
351 txtPassword
.addKeyListener(new KeyAdapter() {
353 public void keyPressed(KeyEvent e
) {
354 if(e
.character
==SWT
.CR
){
355 connectButtonPressed();
360 btnConnect
= new Button(loginComposite
, SWT
.FLAT
);
361 btnConnect
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 1, 1));
362 btnConnect
.addSelectionListener(new SelectionAdapter() {
364 public void widgetSelected(SelectionEvent e
) {
365 connectButtonPressed();
368 btnConnect
.setText(Messages
.RemotingLoginDialog_LABEL_CONNECT
);
370 btnRememberMe
= new Button(loginComposite
, SWT
.CHECK
);
371 btnRememberMe
.setSelection(true);
372 GridData gd_btnRememberMe
= new GridData(SWT
.LEFT
, SWT
.CENTER
, false, false, 2, 1);
373 btnRememberMe
.setLayoutData(gd_btnRememberMe
);
374 btnRememberMe
.setText(Messages
.RemotingLoginDialog_LABEL_REMEMBER_ME
);
376 Label lblDefaultLogin
= new Label(loginComposite
, SWT
.NONE
);
377 GridDataFactory
.fillDefaults().span(4, 1).align(SWT
.TRAIL
, SWT
.CENTER
).applyTo(lblDefaultLogin
);
378 lblDefaultLogin
.setText(String
.format(Messages
.RemotingLoginDialog_DEFAULT_LOGIN
, DEFAULT_USER
, DEFAULT_PASS
));
380 styledTxtMessage
= new StyledText(remotingComposite
, SWT
.NONE
);
381 styledTxtMessage
.setBackground(SWTResourceManager
.getColor(SWT
.COLOR_INFO_BACKGROUND
));
382 styledTxtMessage
.setForeground(SWTResourceManager
.getColor(SWT
.COLOR_DARK_RED
));
383 styledTxtMessage
.setFont(SWTResourceManager
.getFont(UBUNTU
, 12, SWT
.BOLD
));
384 styledTxtMessage
.setSelectionBackground(SWTResourceManager
.getColor(SWT
.COLOR_LIST_SELECTION_TEXT
));
385 styledTxtMessage
.setSelectionForeground(SWTResourceManager
.getColor(SWT
.COLOR_DARK_RED
));
386 styledTxtMessage
.setDoubleClickEnabled(false);
387 styledTxtMessage
.setEditable(false);
388 GridData gd_styledTxtMessage
= new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 1, 1);
389 gd_styledTxtMessage
.exclude
= true;
390 gd_styledTxtMessage
.minimumHeight
= MESSAGE_HEIGHT
;
391 gd_styledTxtMessage
.heightHint
= MESSAGE_HEIGHT
;
392 styledTxtMessage
.setLayoutData(gd_styledTxtMessage
);
394 xpndblcmpstAdvanced
= new ExpandableComposite(remotingComposite
, SWT
.NONE
, ExpandableComposite
.TWISTIE
);
395 GridData gd_xpndblcmpstAdvanced
= new GridData(SWT
.FILL
, SWT
.FILL
, false, true, 1, 1);
396 gd_xpndblcmpstAdvanced
.heightHint
= 19;
397 xpndblcmpstAdvanced
.setLayoutData(gd_xpndblcmpstAdvanced
);
398 xpndblcmpstAdvanced
.addExpansionListener(new IExpansionListener() {
400 public void expansionStateChanged(ExpansionEvent e
) {
402 shlConnect
.setSize(MIN_WIDTH
, MIN_EXP_HEIGHT
);
404 shlConnect
.setSize(MIN_WIDTH
, MIN_HEIGHT
);
409 public void expansionStateChanging(ExpansionEvent e
) {
412 xpndblcmpstAdvanced
.setText(Messages
.RemotingLoginDialog_LABEL_ADVANCED
);
413 xpndblcmpstAdvanced
.setExpanded(true);
415 compAdvanced
= new Composite(xpndblcmpstAdvanced
, SWT
.NONE
);
416 xpndblcmpstAdvanced
.setClient(compAdvanced
);
417 compAdvanced
.setLayout(new GridLayout(4, false));
419 lblPort
= new Label(compAdvanced
, SWT
.CENTER
);
420 lblPort
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
421 lblPort
.setSize(0, 0);
422 lblPort
.setText(Messages
.RemotingLoginDialog_LABEL_PORT
);
423 lblPort
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
425 txtPort
= new Text(compAdvanced
, SWT
.BORDER
);
426 GridData gd_txtPort
= new GridData(SWT
.FILL
, SWT
.CENTER
, false, false, 1, 1);
427 gd_txtPort
.minimumWidth
= 50;
428 gd_txtPort
.widthHint
= 50;
429 txtPort
.setLayoutData(gd_txtPort
);
431 lblServerVersion
= new Label(compAdvanced
, SWT
.CENTER
);
432 lblServerVersion
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
433 lblServerVersion
.setText(Messages
.RemotingLoginDialog_LABEL_SERVER_CDMLIB_VERSION
);
434 lblServerVersion
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
436 txtServerVersion
= new Text(compAdvanced
, SWT
.BORDER
);
437 txtServerVersion
.setEditable(false);
438 txtServerVersion
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, false, false, 1, 1));
439 btnStopServer
= new Button(compAdvanced
, SWT
.FLAT
);
440 btnStopServer
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, false, 2, 1));
441 btnStopServer
.addMouseListener(new MouseAdapter() {
443 public void mouseUp(MouseEvent e
) {
447 btnStopServer
.setText(Messages
.RemotingLoginDialog_LABEL_STOP_MANAGED_SERVER
);
449 lblEditorVersion
= new Label(compAdvanced
, SWT
.CENTER
);
450 lblEditorVersion
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
451 lblEditorVersion
.setText(Messages
.RemotingLoginDialog_LABEL_EDITOR_CDMLIB_VERSION
);
452 lblEditorVersion
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
454 txtEditorVersion
= new Text(compAdvanced
, SWT
.BORDER
);
455 txtEditorVersion
.setEditable(false);
456 txtEditorVersion
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1));
457 new Label(compAdvanced
, SWT
.NONE
);
458 new Label(compAdvanced
, SWT
.NONE
);
460 lblServerCDMVersion
= new Label(compAdvanced
, SWT
.CENTER
);
461 lblServerCDMVersion
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
462 lblServerCDMVersion
.setText(Messages
.RemotingLoginDialog_LABEL_SERVER_CDM_VERSION
);
463 lblServerCDMVersion
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
465 txtServerCDMVersion
= new Text(compAdvanced
, SWT
.BORDER
);
466 txtServerCDMVersion
.setEditable(false);
467 txtServerCDMVersion
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1));
468 new Label(compAdvanced
, SWT
.NONE
);
469 new Label(compAdvanced
, SWT
.NONE
);
471 lblEditorCDMVersion
= new Label(compAdvanced
, SWT
.CENTER
);
472 lblEditorCDMVersion
.setLayoutData(new GridData(SWT
.RIGHT
, SWT
.CENTER
, false, false, 1, 1));
473 lblEditorCDMVersion
.setText(Messages
.RemotingLoginDialog_LABEL_EDITOR_CDM_VERSION
);
474 lblEditorCDMVersion
.setFont(SWTResourceManager
.getFont(UBUNTU
, 9, SWT
.NORMAL
));
476 txtEditorCDMVersion
= new Text(compAdvanced
, SWT
.BORDER
);
477 txtEditorCDMVersion
.setEditable(false);
478 txtEditorCDMVersion
.setLayoutData(new GridData(SWT
.FILL
, SWT
.CENTER
, true, false, 1, 1));
482 private void connectButtonPressed() {
483 if(selectedCsii
.isLocalhostMgd() && !isSelectedCdmInstanceRunningInManagedServer()) {
484 startManagedServer();
487 if (CdmStore
.isActive()){
488 PreferencesUtil
.setNomenclaturalCodePreferences();
494 private void populateCdmServerCombo() {
495 Job job
= new Job(Messages
.RemotingLoginDialog_RETRIEVE_SERVER_INSTANCES
) {
497 protected IStatus
run(IProgressMonitor monitor
) {
498 Display
.getDefault().syncExec(new Runnable() {
501 for(CdmServerInfo csii
: CdmServerInfo
.getCdmServers()) {
502 csiiMap
.put(csii
.getName(), csii
);
503 comboCdmServer
.add(csii
.getName());
505 int serverIndex
= -1;
506 if(serverName
!= null) {
507 serverIndex
= comboCdmServer
.indexOf(serverName
);
509 if(serverIndex
== -1) {
510 comboCdmServer
.select(0);
513 comboCdmServer
.select(serverIndex
);
515 CdmRemoteSource devRemoteSource
= CdmServerInfo
.getDevServerRemoteSource();
516 if(devRemoteSource
!= null) {
517 isDevRemoteSource
= true;
518 String username
= System
.getProperty("cdm.server.dev.username"); //$NON-NLS-1$
519 String password
= System
.getProperty("cdm.server.dev.password"); //$NON-NLS-1$
520 if(username
!= null && !username
.isEmpty() && password
!= null && !password
.isEmpty()) {
521 txtLogin
.setText(username
);
522 txtPassword
.setText(password
);
523 CdmStore
.connect(devRemoteSource
, RemotingLoginDialog
.this);
530 return Status
.OK_STATUS
;
537 private void refreshCdmServer() {
539 txtCdmServerStatus
.setText(STATUS_CHECKING_AVAILABILITY
);
540 clearOnServerChange();
542 updateSelectedCdmServer();
543 Display
.getDefault().asyncExec(new Runnable() {
546 checkSelectedCdmServer();
550 catch(SWTException e
){
551 //catch widget is disposed exception which may occurr if
552 //dialog is closed but the runnable tries to update
556 private void updateSelectedCdmServer() {
557 int selIndex
= comboCdmServer
.getSelectionIndex();
559 selectedCsii
= csiiMap
.get(comboCdmServer
.getItem(selIndex
));
563 private void updatePort() {
564 txtPort
.setText(""); //$NON-NLS-1$
565 if(selectedCsii
!= null) {
566 int port
= selectedCsii
.getPort();
567 if(port
== CdmServerInfo
.NULL_PORT
) {
568 txtPort
.setText(CdmServerInfo
.NULL_PORT_STRING
);
570 txtPort
.setText(String
.valueOf(port
));
575 private int getPort() {
576 int port
= CdmServerInfo
.NULL_PORT
;
578 port
= Integer
.valueOf(txtPort
.getText());
579 } catch (NumberFormatException nfe
) {
580 if(!CdmServerInfo
.NULL_PORT_STRING
.equals(txtPort
.getText())) {
581 setMessage(Messages
.RemotingLoginDialog_MESSAGE_PORT_SHOULD_BE_INTEGER
);
587 private void checkSelectedCdmServer() {
588 if(selectedCsii
!= null) {
589 if(selectedCsii
.isLocalhost()) {
590 txtPort
.setEditable(true);
591 txtPort
.setEnabled(true);
593 if(selectedCsii
.pingServer()) {
594 txtCdmServerStatus
.setText(STATUS_AVAILABLE
);
595 populateCdmInstanceCombo(true);
596 String serverVersionTimestamp
= generateLastModifiedTooltip(selectedCsii
.getCdmlibLastModified());
597 txtServerVersion
.setText(selectedCsii
.getCdmlibServicesVersion() + ":" + serverVersionTimestamp
); //$NON-NLS-1$
599 txtCdmServerStatus
.setText(STATUS_NOT_AVAILABLE
);
600 comboCdmInstance
.removeAll();
601 disableCdmInstanceControls("", "");
608 private void populateCdmInstanceCombo(final boolean forceRefresh
) {
609 comboCdmInstance
.removeAll();
610 comboCdmInstance
.setEnabled(false);
611 btnConnect
.setEnabled(false);
612 txtCdmInstanceStatus
.setText(STATUS_RETRIEVING
);
613 txtCdmInstanceStatus
.setToolTipText(""); //$NON-NLS-1$
615 serverJob
= new Job(Messages
.RemotingLoginDialog_RETRIEVE_SERVER_INSTANCES
) {
617 protected IStatus
run(IProgressMonitor monitor
) {
619 if(selectedCsii
!= null) {
621 selectedCsii
.refreshInstances();
623 final List
<CdmInstanceInfo
> instances
= selectedCsii
.getInstances();
624 Display
.getDefault().asyncExec(new Runnable() {
627 if(!instances
.isEmpty()) {
628 for(CdmInstanceInfo cdmInstance
: instances
) {
629 comboCdmInstance
.add(cdmInstance
.getName());
631 int instanceIndex
= -1;
632 if(instanceName
!= null) {
633 instanceIndex
= comboCdmInstance
.indexOf(instanceName
);
635 if(instanceIndex
== -1) {
636 comboCdmInstance
.select(0);
639 comboCdmInstance
.select(instanceIndex
);
641 refreshCdmInstance();
642 comboCdmInstance
.setEnabled(true);
648 txtCdmInstanceStatus
.setText(STATUS_NO_INSTANCES
);
649 btnConnect
.setEnabled(false);
654 } catch (final CDMServerException e
) {
655 MessagingUtils
.warn(getClass(), e
);
656 Display
.getDefault().asyncExec(new Runnable() {
659 disableCdmInstanceControls(STATUS_NOT_AVAILABLE
, e
.getMessage());
663 return Status
.OK_STATUS
;
667 if(txtCdmServerStatus
.getText().equals(STATUS_AVAILABLE
) && !isDevRemoteSource
) {
669 serverJob
.schedule();
673 private void disableCdmInstanceControls(String cdmInstanceStatus
, String tooltip
) {
674 txtCdmInstanceStatus
.setText(cdmInstanceStatus
);
675 txtCdmInstanceStatus
.setToolTipText(tooltip
);
676 comboCdmInstance
.setEnabled(false);
677 btnConnect
.setEnabled(false);
680 private void refreshCdmInstance() {
681 txtCdmInstanceStatus
.setText(STATUS_CHECKING_AVAILABILITY
);
682 clearOnInstanceChange();
683 updateSelectedCdmInstance();
684 checkSelectedCdmInstance();
685 updateManagedServerControls();
688 private void updateSelectedCdmInstance() {
689 int selIndex
= comboCdmInstance
.getSelectionIndex();
691 selectedCdmInstance
= selectedCsii
.getInstanceFromName(comboCdmInstance
.getItem(selIndex
));
693 if(loadLoginPrefs
&& !isDevRemoteSource
) {
694 readPrefCredentials();
699 private void updateManagedServerControls() {
700 if(selectedCsii
.isLocalhostMgd()) {
701 if(isSelectedCdmInstanceRunningInManagedServer()) {
702 txtCdmInstanceStatus
.setText(STATUS_STARTED
);
704 txtCdmInstanceStatus
.setText(STATUS_NOT_STARTED
);
706 btnConnect
.setEnabled(true);
707 selectedCsii
.setPort(getManagedServerPort());
712 if(isManagedServerRunning()) {
713 btnStopServer
.setEnabled(true);
715 btnStopServer
.setEnabled(false);
719 private boolean isManagedServerRunning() {
720 return CdmStore
.getManagedServer() != null && CdmStore
.getManagedServer().isAlive();
723 private boolean isSelectedCdmInstanceRunningInManagedServer() {
724 return CdmStore
.getManagedServer() != null &&
725 CdmStore
.getManagedServer().isAlive() &&
726 selectedCsii
.isLocalhostMgd() &&
727 CdmStore
.getManagedServer().getDataSourceName().equals(selectedCdmInstance
.getName());
730 private void startManagedServer() {
731 if(isManagedServerRunning()) {
732 if(CdmStore
.getManagedServer().getDataSourceName().equals(selectedCdmInstance
.getName())) {
735 Display
.getDefault().syncExec(new Runnable() {
745 Job job
= new Job(Messages
.RemotingLoginDialog_JOB_SERVER_LAUNCH
) {
748 public IStatus
run(IProgressMonitor monitor
) {
749 String mgdServerConfigFileName
= "mgd.datasources.xml"; //$NON-NLS-1$
750 String config
= CDMServerUtils
.convertEditorToServerConfig();
751 File managedServerConfigFile
;
753 monitor
.beginTask(Messages
.RemotingLoginDialog_TASK_LAUNCHING_SERVER
, maxUnits
);
755 monitor
.subTask(String
.format(Messages
.RemotingLoginDialog_GENERATING_CONFIG_FILE
, selectedCdmInstance
.getName()));
756 managedServerConfigFile
= CDMServerUtils
.writeManagedServerConfig(config
, mgdServerConfigFileName
);
758 CdmStore
.setManagedServer(new CDMServer(selectedCdmInstance
.getName(), managedServerConfigFile
));
759 monitor
.subTask(Messages
.RemotingLoginDialog_STARTING_MGD_SERVER
);
760 CdmStore
.getManagedServer().start(false, RemotingLoginDialog
.this);
763 // the following loop is a 'fake' progress monitoring where the progress
764 // bar is advanced by one unit every second until maxUnits -2
765 while(!CdmStore
.getManagedServer().isStarted() && !CdmStore
.getManagedServer().isFailed()) {
766 if(serverUnits
< maxUnits
- 2) {
769 } catch (InterruptedException e
) {
775 Display
.getDefault().asyncExec(new Runnable() {
779 updateManagedServerControls();
783 } catch (IOException ioe
) {
784 MessagingUtils
.errorDialog(Messages
.RemotingLoginDialog_ERROR_GENERATING_CONFIG_FILE
,
787 TaxeditorStorePlugin
.PLUGIN_ID
,
790 } catch (CDMEmbeddedServerException cse
) {
791 MessagingUtils
.errorDialog(Messages
.RemotingLoginDialog_ERROR_STARTING_SERVER
,
794 TaxeditorStorePlugin
.PLUGIN_ID
,
800 return Status
.OK_STATUS
;
805 job
.setProperty(IProgressConstants
.KEEP_PROPERTY
, true);
812 private void stopManagedServer() {
814 CdmStore
.getManagedServer().stop();
815 } catch (Exception e
) {
816 MessagingUtils
.errorDialog(Messages
.RemotingLoginDialog_ERROR_STOPPING_SERVER
,
818 String
.format(Messages
.RemotingLoginDialog_COULD_NOT_STOP_SERVER
, CdmStore
.getManagedServer().getPort()),
819 TaxeditorStorePlugin
.PLUGIN_ID
,
823 CdmStore
.setManagedServer(null);
824 updateManagedServerControls();
827 private int getManagedServerPort() {
828 return CdmStore
.getManagedServer() == null ? CdmServerInfo
.NULL_PORT
: CdmStore
.getManagedServer().getPort();
831 private void checkSelectedCdmInstance() {
832 boolean available
= false;
833 String status
= STATUS_NOT_AVAILABLE
;
834 String message
= null;
836 if(txtCdmServerStatus
.getText().equals(STATUS_AVAILABLE
)) {
838 if(selectedCsii
.pingInstance(selectedCdmInstance
, getPort())) {
839 status
= STATUS_AVAILABLE
;
842 status
= STATUS_NOT_AVAILABLE
;
847 txtServerCDMVersion
.setText(selectedCsii
.getCdmRemoteSource(selectedCdmInstance
, getPort()).getDbSchemaVersion());
848 int compareDbSchemaVersion
= selectedCsii
.compareDbSchemaVersion(selectedCdmInstance
, getPort());
849 int compareCdmlibServicesVersion
= 0;
850 boolean disableServicesApiTimestampCheck
=
851 PreferencesUtil
.getPreferenceStore().getBoolean((IPreferenceKeys
.DISABLE_SERVICES_API_TIMESTAMP_CHECK
));
852 if(!disableServicesApiTimestampCheck
) {
853 compareCdmlibServicesVersion
= selectedCsii
.compareCdmlibServicesVersion();
855 if(compareDbSchemaVersion
> 0 || compareCdmlibServicesVersion
> 0) {
856 status
= STATUS_NOT_COMPATIBLE
;
858 message
= MESG_COMPATIBLE_EDITOR_OLD
;
859 } else if(compareDbSchemaVersion
< 0 || compareCdmlibServicesVersion
< 0) {
860 status
= STATUS_NOT_COMPATIBLE
;
862 message
= MESG_COMPATIBLE_SERVER_OLD
;
864 status
= STATUS_AVAILABLE
;
866 message
= ""; //$NON-NLS-1$
869 } catch (Exception e
) {
870 txtCdmInstanceStatus
.setToolTipText(e
.getMessage());
872 btnConnect
.setEnabled(available
);
873 txtCdmInstanceStatus
.setText(status
);
874 if(!StringUtils
.isBlank(message
)) {
881 private void connect() {
882 checkSelectedCdmInstance();
884 if(!txtCdmInstanceStatus
.getText().equals(STATUS_AVAILABLE
)) {
888 ICdmRemoteSource source
= selectedCsii
.getCdmRemoteSource(selectedCdmInstance
, getPort());
890 if(!validateLogin(source
)) {
895 CdmStore
.connect(source
, this);
896 } catch (Exception e
) {
897 // Do not expect anything to go wrong at this point, so we throw a runtime exception
899 throw new RuntimeException(e
);
905 public boolean isRememberMe() {
906 return btnRememberMe
.getSelection();
909 private void persistPrefLastServerInstance() {
910 IEclipsePreferences preferences
= ConfigurationScope
.INSTANCE
.getNode(STORE_PREFERENCES_NODE
);
911 Preferences lastServerInstancePrefs
= preferences
.node(LAST_SERVER_INSTANCE_NODE
);
913 lastServerInstancePrefs
.put(LAST_SERVER_KEY
, selectedCsii
.getName());
914 lastServerInstancePrefs
.put(LAST_INSTANCE_KEY
, selectedCdmInstance
.getName());
916 flushPreferences(lastServerInstancePrefs
);
919 private void persistPrefCredentials() {
920 IEclipsePreferences preferences
= ConfigurationScope
.INSTANCE
.getNode(STORE_PREFERENCES_NODE
);
921 Preferences credentialsPrefs
= preferences
.node(LOGIN_NODE
);
922 credentialsPrefs
.put(getUsernamePrefKey(), txtLogin
.getText());
923 credentialsPrefs
.put(getPasswordPrefKey(), txtPassword
.getText());
924 flushPreferences(credentialsPrefs
);
927 private void removePrefCredentials() {
928 IEclipsePreferences preferences
= ConfigurationScope
.INSTANCE
.getNode(STORE_PREFERENCES_NODE
);
929 Preferences credentialsPrefs
= preferences
.node(LOGIN_NODE
);
930 credentialsPrefs
.put(getUsernamePrefKey(), txtLogin
.getText());
931 credentialsPrefs
.put(getPasswordPrefKey(), txtPassword
.getText());
932 removePreferences(credentialsPrefs
);
934 private void removePreferences(Preferences prefs
) {
937 } catch (BackingStoreException bse
) {
938 setMessage(bse
.getMessage());
941 private void flushPreferences(Preferences prefs
) {
944 } catch (BackingStoreException bse
) {
945 setMessage(bse
.getMessage());
951 private void readPrefCredentials() {
952 String username
, password
;
953 IEclipsePreferences preferences
= ConfigurationScope
.INSTANCE
.getNode(STORE_PREFERENCES_NODE
);
954 Preferences credentialsPrefs
= preferences
.node(LOGIN_NODE
);
955 username
= credentialsPrefs
.get(getUsernamePrefKey(), ""); //$NON-NLS-1$
956 txtLogin
.setText(username
);
957 password
= credentialsPrefs
.get(getPasswordPrefKey(),""); //$NON-NLS-1$
958 txtPassword
.setText(password
);
959 if(username
.isEmpty() || password
.isEmpty()) {
964 private void readPrefLastServerInstance() {
965 IEclipsePreferences preferences
= ConfigurationScope
.INSTANCE
.getNode(STORE_PREFERENCES_NODE
);
966 Preferences lastServerInstancePrefs
= preferences
.node(LAST_SERVER_INSTANCE_NODE
);
968 serverName
= lastServerInstancePrefs
.get(LAST_SERVER_KEY
, null);
969 instanceName
= lastServerInstancePrefs
.get(LAST_INSTANCE_KEY
, null);
972 private void emptyCredentials() {
973 txtLogin
.setText(""); //$NON-NLS-1$
974 txtPassword
.setText(""); //$NON-NLS-1$
977 private String
getUsernamePrefKey() {
978 return selectedCsii
.toString(selectedCdmInstance
.getName(), getPort()) + USERNAME_SUFFIX
;
981 private String
getPasswordPrefKey() {
982 return selectedCsii
.toString(selectedCdmInstance
.getName(), getPort()) + PASSWORD_SUFFIX
;
985 private boolean validateLogin(ICdmRemoteSource remoteSource
) {
986 if(getUsername() == null || getUsername().isEmpty()) {
987 setMessage(Messages
.RemotingLoginDialog_LOGIN_CANNOT_BE_EMPTY
);
990 if(getPassword() == null || getPassword().isEmpty()) {
991 setMessage(Messages
.RemotingLoginDialog_PASSWORD_CANNOT_BE_EMPTY
);
997 IUserService userService
= CdmApplicationRemoteConfiguration
.getUserService(remoteSource
);
998 UsernamePasswordAuthenticationToken token
= new UsernamePasswordAuthenticationToken(getUsername(), getPassword());
999 CdmApplicationRemoteConfiguration
.getAuthenticationManager(userService
).authenticate(token
);
1000 } catch(BadCredentialsException e
){
1001 setMessage(LoginManager
.INCORRECT_CREDENTIALS_MESSAGE
);
1003 } catch(LockedException e
){
1004 setMessage(LoginManager
.ACCOUNT_LOCKED_MESSAGE
);
1006 } catch(IllegalArgumentException e
){
1007 setMessage(LoginManager
.INCORRECT_CREDENTIALS_MESSAGE
);
1013 public String
getUsername() {
1014 return txtLogin
.getText();
1017 public String
getPassword() {
1018 return txtPassword
.getText();
1021 public void setMessage(String message
) {
1022 if(message
!= null && !message
.isEmpty()) {
1023 if(message
.length() > 60) {
1024 styledTxtMessage
.setToolTipText(message
);
1025 message
= message
.substring(0, 60) + "..."; //$NON-NLS-1$
1027 styledTxtMessage
.setText(message
);
1028 styledTxtMessage
.setVisible(true);
1029 ((GridData
)styledTxtMessage
.getLayoutData()).exclude
= false;
1030 shlConnect
.setSize(MIN_WIDTH
, getHeightWithoutMessage() + MESSAGE_HEIGHT
);
1031 shlConnect
.setMinimumSize(MIN_WIDTH
, getHeightWithoutMessage() + MESSAGE_HEIGHT
);
1033 styledTxtMessage
.setText(""); //$NON-NLS-1$
1034 styledTxtMessage
.setVisible(false);
1035 ((GridData
)styledTxtMessage
.getLayoutData()).exclude
= true;
1036 shlConnect
.setSize(MIN_WIDTH
, getHeightWithoutMessage());
1037 shlConnect
.setMinimumSize(MIN_WIDTH
, getHeightWithoutMessage());
1039 remotingComposite
.layout();
1042 private int getHeightWithoutMessage() {
1043 if(xpndblcmpstAdvanced
.isExpanded()) {
1044 return MIN_EXP_HEIGHT
;
1051 public void hide(boolean isHidden
) {
1052 if(shlConnect
!= null && shlConnect
.getDisplay() != null) {
1053 shlConnect
.setVisible(!isHidden
);
1056 public void dispose() {
1057 if(shlConnect
!= null && shlConnect
.getDisplay() != null) {
1058 shlConnect
.dispose();
1062 public void onComplete() {
1063 Display
.getDefault().asyncExec(new Runnable() {
1066 if(!isDevRemoteSource
) {
1067 if(isRememberMe()) {
1068 persistPrefCredentials();
1070 removePrefCredentials();
1072 persistPrefLastServerInstance();
1079 private String
generateLastModifiedTooltip(String cdmlibLastModified
) {
1080 if(StringUtils
.isBlank(cdmlibLastModified
)) {
1081 return ""; //$NON-NLS-1$
1083 SimpleDateFormat sdf
= new SimpleDateFormat("yyyy.MM.dd.HH.mm.z"); //$NON-NLS-1$
1084 Date cdmlibLastModifiedDate
;
1085 String cdmlibLastModifiedTimestamp
= ""; //$NON-NLS-1$
1087 cdmlibLastModifiedDate
= new Date(Long
.valueOf(cdmlibLastModified
));
1088 cdmlibLastModifiedTimestamp
= sdf
.format(cdmlibLastModifiedDate
);
1090 return cdmlibLastModifiedTimestamp
;
1093 private void setEditorInfo() {
1094 txtEditorCDMVersion
.setText(CdmMetaData
.getDbSchemaVersion());
1095 String editorVersionTimestamp
= generateLastModifiedTooltip(CdmApplicationState
.getCdmlibLastModified());
1096 txtEditorVersion
.setText(CdmApplicationState
.getCdmlibVersion() + ":" + editorVersionTimestamp
); //$NON-NLS-1$
1099 private void clearOnServerChange() {
1100 setMessage(""); //$NON-NLS-1$
1101 txtServerCDMVersion
.setText(""); //$NON-NLS-1$
1102 txtServerVersion
.setText(""); //$NON-NLS-1$
1103 txtServerVersion
.setToolTipText(""); //$NON-NLS-1$
1104 txtServerCDMVersion
.setText(""); //$NON-NLS-1$
1105 comboCdmInstance
.removeAll();
1106 txtCdmInstanceStatus
.setText(""); //$NON-NLS-1$
1107 txtPort
.setEditable(false);
1108 txtPort
.setEnabled(false);
1111 private void clearOnInstanceChange() {
1112 setMessage(""); //$NON-NLS-1$
1113 txtServerCDMVersion
.setText(""); //$NON-NLS-1$
1120 public void handleError(final Throwable t
) {
1122 Display
.getDefault().syncExec(new Runnable() {
1127 String title
= Messages
.RemotingLoginDialog_SERVER_LAUNCH_ERROR
;
1128 String message
= t
.getMessage();
1131 MessagingUtils
.errorDialog(title
,
1134 TaxeditorStorePlugin
.PLUGIN_ID
,