Project

General

Profile

« Previous | Next » 

Revision 079cd0bf

Added by Katja Luther almost 4 years ago

set location of login dialog to center of application

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/SpecimenSelectionDialog.java
234 234
        list.setComparator(comp);
235 235

  
236 236
        //gather specimens
237
        if(matrix.getSpecimenCache()==null){
237
        if(matrix.getSpecimenCache()==null || matrix.getSpecimenCache().isEmpty()){
238 238
            loadSpecimens();
239 239
        }
240 240
        if(treeIndexList !=null){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java
36 36
import org.eclipse.swt.events.SelectionAdapter;
37 37
import org.eclipse.swt.events.SelectionEvent;
38 38
import org.eclipse.swt.graphics.Color;
39
import org.eclipse.swt.graphics.Point;
40
import org.eclipse.swt.graphics.Rectangle;
39 41
import org.eclipse.swt.layout.FillLayout;
40 42
import org.eclipse.swt.layout.GridData;
41 43
import org.eclipse.swt.layout.GridLayout;
......
224 226
        setEditorInfo();
225 227
        populateCdmServerCombo();
226 228
        shlConnect.pack(true);
229

  
230
        setCenterPoint();
227 231
        shlConnect.open();
228 232

  
229 233
        Display display = getParent().getDisplay();
......
241 245
     * Create contents of the dialog.
242 246
     */
243 247
    private void createContents() {
244
        shlConnect = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
248
        shlConnect = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.CENTER);
245 249
        shlConnect.setText(LABEL_CONNECT);
246 250
        shlConnect.setLayout(new FillLayout(SWT.HORIZONTAL));
247 251

  
......
265 269
                onRefreshCdmServer();
266 270
            }
267 271
        });
272

  
268 273
        GridData gd_comboCdmServer = new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1);
274

  
269 275
        comboCdmServer.setLayoutData(gd_comboCdmServer);
270 276
        comboCdmServer.select(0);
271 277

  
......
302 308
                onRefreshCdmInstance();
303 309
            }
304 310
        });
311

  
305 312
        GridData gd_comboCdmInstance = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
306 313
        gd_comboCdmInstance.minimumWidth = COMBO_MIN_WIDTH;
314

  
307 315
        comboCdmInstance.setLayoutData(gd_comboCdmInstance);
308 316
        comboCdmInstance.select(0);
309 317

  
......
476 484
        txtEditorCdmVersion.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
477 485
    }
478 486

  
487
    public void setCenterPoint() {
488
        Rectangle parentSize = getParent().getBounds();
489
        Rectangle shellSize = shlConnect.getBounds();
490
        int locationX = (parentSize.width - shellSize.width)/2+parentSize.x;
491
        int locationY = (parentSize.height - shellSize.height)/2+parentSize.y;
492
        shlConnect.setLocation(new Point(locationX, locationY));
493

  
494
    }
495

  
496

  
497

  
498

  
499

  
500

  
479 501
    @SuppressWarnings("unused")
480 502
    private void addEmptyCells(int cnt) {
481 503
        for (int i = 0; i < cnt; i++) {

Also available in: Unified diff