Project

General

Profile

« Previous | Next » 

Revision 3b8b41d9

Added by Andreas Müller almost 4 years ago

cleanup

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java
93 93
    private static final String DEFAULT_PASS = "00000"; //$NON-NLS-1$
94 94
    private static final String DEFAULT_USER = "admin"; //$NON-NLS-1$
95 95

  
96
	protected Object result;
97
    protected Shell shlConnect;
98
    private Text txtCdmServerStatus;
99
    private Text txtCdmInstanceStatus;
100
    private Combo comboCdmServer;
101
    private Combo comboCdmInstance;
102
    private Button btnConnect;
103

  
104
    private final Map<String, CdmServerInfo> csiiMap = new HashMap<>();
105

  
106 96
    private final static String STATUS_AVAILABLE = Messages.RemotingLoginDialog_STATUS_AVAILABLE;
107 97
    private final static String STATUS_NOT_AVAILABLE = Messages.RemotingLoginDialog_STATUS_NOT_AVAILABLE;
108 98
    private final static String STATUS_STARTED = Messages.RemotingLoginDialog_STATUS_STARTED;
......
132 122
    private final static String LAST_SERVER_KEY = "lastServerKey"; //$NON-NLS-1$
133 123
    private final static String LAST_INSTANCE_KEY = "lastInstanceKey"; //$NON-NLS-1$
134 124

  
125
    protected Shell shlConnect;
126
    private Text txtCdmServerStatus;
127
    private Text txtCdmInstanceStatus;
128
    private Combo comboCdmServer;
129
    private Combo comboCdmInstance;
130
    private Button btnConnect;
131

  
135 132
    private Composite remotingComposite;
136
    private CdmServerInfo selectedServerInfo;
137
    private CdmInstanceInfo selectedCdmInstance;
138 133
    private Button btnCdmServerRefresh;
139 134
    private Button btnCdmInstanceRefresh;
140 135
    private Button btnStopServer;
......
153 148
    private ExpandableComposite expandableCompositeAdvanced;
154 149
    private StyledText styledTxtMessage;
155 150

  
156
//    private final int MIN_WIDTH = 530;
157
//    private final int MIN_HEIGHT = 220;
158
//    private final int MIN_EXP_HEIGHT = 380;
159

  
160
    private final int MESSAGE_HEIGHT = 50;
161 151
    private Label lblEditorCdmlibVersion;
162 152
    private Text txtEditorCdmlibVersion;
163 153
    private Label lblServerSchemaVersion;
......
165 155
    private Label lblEditorCdmVersion;
166 156
    private Text txtEditorCdmVersion;
167 157

  
168
    private String serverName, instanceName;
158
    private final int MESSAGE_HEIGHT = 50;
159
//  private final int MIN_WIDTH = 530;
160
//  private final int MIN_HEIGHT = 220;
161
//  private final int MIN_EXP_HEIGHT = 380;
162

  
169 163
    private boolean autoConnect = false;
170 164
    private boolean loadLoginPrefs = true;
171 165
    private boolean isDevRemoteSource = false;
166

  
172 167
    private Job serverJob;
168
    protected Object result;
169

  
170
    private final Map<String, CdmServerInfo> serverInfoMap = new HashMap<>();
171

  
172
    private String serverName;
173
    private String instanceName;
174
    private CdmServerInfo selectedServerInfo;
175
    private CdmInstanceInfo selectedCdmInstance;
173 176

  
174 177
    /**
175 178
     * Create the dialog.
......
211 214
        if(serverName == null && instanceName == null) {
212 215
            readPrefLastServerInstance();
213 216
        }
217
        expandableCompositeAdvanced.setExpanded(false);
214 218

  
215 219
        setEditorInfo();
216 220
        populateCdmServerCombo();
217 221
        shlConnect.pack(true);
218 222
        shlConnect.open();
219 223

  
220
        expandableCompositeAdvanced.setExpanded(false);
221

  
222 224
        Display display = getParent().getDisplay();
223

  
224 225
        while (!shlConnect.isDisposed()) {
225 226
            if (!display.isDisposed()){
226 227
                if (!display.readAndDispatch()) {
......
228 229
                }
229 230
            }
230 231
        }
231

  
232 232
        return result;
233 233
    }
234 234

  
......
268 268
        txtCdmServerStatus.setBackground(SWTResourceManager.getColor(SWT.COLOR_INFO_BACKGROUND));
269 269
        txtCdmServerStatus.setEditable(false);
270 270
        GridData gd_txtCdmServerStatus = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
271

  
272 271
        txtCdmServerStatus.setLayoutData(gd_txtCdmServerStatus);
273 272

  
274 273
        btnCdmServerRefresh = new Button(cdmServerComposite, SWT.NONE);
......
316 315
        btnCdmInstanceRefresh.setLayoutData(gd_btnCdmInstanceRefresh);
317 316
        btnCdmInstanceRefresh.setText(Messages.RemotingLoginDialog_LABEL_REFRESH);
318 317

  
319
        //login
318
        //login + connect
320 319
        loginComposite = new Composite(remotingComposite, SWT.NONE);
321 320
        GridData gd_loginComposite = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
322 321
        loginComposite.setLayoutData(gd_loginComposite);
......
363 362
		});
364 363
        btnConnect.setText(LABEL_CONNECT);
365 364

  
365
        //rememberMe + default values
366 366
        btnRememberMe = new Button(loginComposite, SWT.CHECK);
367 367
        btnRememberMe.setSelection(true);
368 368
        GridData gd_btnRememberMe = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
......
490 490
                    public void run() {
491 491
                        //TODO performance
492 492
                        for(CdmServerInfo csii : CdmServerInfo.getCdmServers()) {
493
                            csiiMap.put(csii.getName(), csii);
493
                            serverInfoMap.put(csii.getName(), csii);
494 494
                            comboCdmServer.add(csii.getName());
495 495
                        }
496 496
                        int serverIndex = -1;
......
538 538
            });
539 539
        }
540 540
        catch(SWTException e){
541
            //catch widget is disposed exception which may occurr if
541
            //catch widget is disposed exception which may occur if
542 542
            //dialog is closed but the runnable tries to update
543 543
        }
544 544
    }
......
546 546
    private void updateSelectedCdmServer() {
547 547
        int selIndex = comboCdmServer.getSelectionIndex();
548 548
        if(selIndex != -1) {
549
            selectedServerInfo = csiiMap.get(comboCdmServer.getItem(selIndex));
549
            selectedServerInfo = serverInfoMap.get(comboCdmServer.getItem(selIndex));
550 550
        }
551 551
    }
552 552

  
......
1252 1252
        setMessage(""); //$NON-NLS-1$
1253 1253
        txtServerSchemaVersion.setText(""); //$NON-NLS-1$
1254 1254
    }
1255

  
1256
    private void updateControls(){
1257

  
1258
        //server
1259
//        comboCdmServer; //nothing TODO
1260
//        txtCdmServerStatus;
1261
//        btnCdmServerRefresh.setEnabled(true);
1262

  
1263
        //database
1264
//        comboCdmInstance
1265
//        txtCdmInstanceStatus
1266
//        btnCdmInstanceRefresh;
1267

  
1268
        //login + connect
1269
//        txtLogin;
1270
//        txtPassword;
1271
//        btnConnect;
1272

  
1273
        //rememberMe + defaultValues
1274
//        btnRememberMe;
1275
//        lblDefaultLogin;
1276

  
1277
        //message
1278
//        styledTxtMessage;
1279

  
1280
        //Advanced
1281
//        txtPort
1282
//        btnStopServer;
1283

  
1284
//        txtServerCdmlibVersion;
1285
//        txtEditorCdmlibVersion;
1286
//        txtServerSchemaVersion;
1287
//        txtEditorCdmVersion;
1288
    }
1255 1289
}

Also available in: Unified diff