Project

General

Profile

« Previous | Next » 

Revision cb36db97

Added by Katja Luther about 4 years ago

ref #8047: move remove button to status bar

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionEditor.java
140 140
    private Integer countNodes;
141 141
    private Text searchText;
142 142

  
143
    Button button3;
144

  
143 145
    EventList<TaxonDistributionDTO> taxonList;
144 146
    Map<UUID,Map<NamedArea,Set<DescriptionElementBase>>> taxonDistributionMap = new HashMap<>();
145 147

  
......
234 236
        gridData.grabExcessHorizontalSpace = true;
235 237
        gridData.horizontalAlignment = GridData.FILL;
236 238
        GridLayout gridLayout = new GridLayout();
237
        gridLayout.numColumns = 2;
239
        gridLayout.numColumns = 3;
238 240
        composite.setLayoutData(gridData);
239 241
        composite.setLayout(gridLayout);
240 242

  
......
256 258
            statusLabelSourceReference.setText(Messages.DistributionEditor_defaultSource + defaultSource.getAbbrevTitle() != null? defaultSource.getAbbrevTitle() : defaultSource.getAbbrevTitleCache());
257 259

  
258 260
        }
261

  
262
        button3 = new Button(composite, SWT.PUSH );
263
        button3.setEnabled(false);
264
        GridData gridData3 = new GridData();
265
        gridData3.horizontalAlignment = SWT.RIGHT;
266
        button3.setLayoutData(gridData3);
267
        button3.setText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE);
268
        button3.setToolTipText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE_TOOLTIP);
269
        button3.addSelectionListener(new SelectionAdapter() {
270

  
271
            @Override
272
            public void widgetSelected(SelectionEvent event) {
273
                defaultSource = null;
274

  
275
                String defaultSourceStr = (defaultSource == null) ? "" : Messages.DistributionEditor_defaultSource + defaultSource.getTitleCache(); //$NON-NLS-1$
276
                if (defaultSourceStr.length()> 100){
277
                    defaultSourceStr = defaultSourceStr.substring(0, 98) + "..."; //$NON-NLS-1$
278
                }
279
                statusLabelSourceReference.setText(defaultSourceStr);
280

  
281
                button3.setBackground(EditorUtil.getColor(Resources.COLOR_CONTROL_SELECTED));
282
                button3.setEnabled(false);
283
            }
284

  
285
        });
286

  
259 287
    }
260 288

  
261 289
    private void applyStyles(){
......
449 477

  
450 478
        Button button2 = new Button(parent, SWT.PUSH );
451 479
        GridData gridData3 = new GridData();
452
        gridData2.horizontalSpan = 1;
453
        button2.setLayoutData(gridData3);
480
        gridData3.horizontalAlignment = SWT.RIGHT;
454 481

  
482
        button2.setLayoutData(gridData3);
455 483

  
456 484
        button2.setText(Messages.ChecklistEditor_DEFAULT_SOURCE);
457 485
        button2.setToolTipText(Messages.ChecklistEditor_DEFAULT_SOURCE_TOOLTIP);
......
469 497

  
470 498
                button2.setBackground(EditorUtil.getColor(Resources.COLOR_CONTROL_SELECTED));
471 499
                EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
500
                button3.setEnabled(true);
472 501
            }
473 502

  
474 503
        });
475 504

  
476
        Button button3 = new Button(parent, SWT.PUSH );
477

  
478
        button3.setLayoutData(gridData3);
479
        button3.setText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE);
480
        button2.setToolTipText(Messages.ChecklistEditor_REMOVE_DEFAULT_SOURCE_TOOLTIP);
481
        button3.addSelectionListener(new SelectionAdapter() {
482

  
483
            @Override
484
            public void widgetSelected(SelectionEvent event) {
485
                defaultSource = null;
486 505

  
487
                String defaultSourceStr = (defaultSource == null) ? "" : Messages.DistributionEditor_defaultSource + defaultSource.getTitleCache(); //$NON-NLS-1$
488
                if (defaultSourceStr.length()> 100){
489
                    defaultSourceStr = defaultSourceStr.substring(0, 98) + "..."; //$NON-NLS-1$
490
                }
491
                statusLabelSourceReference.setText(defaultSourceStr);
492 506

  
493
                button3.setBackground(EditorUtil.getColor(Resources.COLOR_CONTROL_SELECTED));
494
            }
495 507

  
496
        });
497 508

  
498 509
        parent.pack();
499 510
        return searchText;

Also available in: Unified diff