Project

General

Profile

Revision ceac293a

IDceac293aa0d0f22d645b7dbc5fe1335ef5cff504
Parent 0dfdf125
Child 84832a69

Added by Katja Luther over 2 years ago

revert edit of text in bulkeditor and resize of columns

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
21 21

  
22 22
import org.eclipse.core.runtime.IProgressMonitor;
23 23
import org.eclipse.core.runtime.NullProgressMonitor;
24
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
25 24
import org.eclipse.e4.core.contexts.IEclipseContext;
26 25
import org.eclipse.e4.core.di.annotations.Optional;
27 26
import org.eclipse.e4.core.services.events.IEventBroker;
......
40 39
import org.eclipse.nebula.widgets.nattable.NatTable;
41 40
import org.eclipse.nebula.widgets.nattable.command.VisualRefreshCommand;
42 41
import org.eclipse.nebula.widgets.nattable.command.VisualRefreshCommandHandler;
43
import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration;
44 42
import org.eclipse.nebula.widgets.nattable.config.AbstractUiBindingConfiguration;
45 43
import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry;
46 44
import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration;
47
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
48
import org.eclipse.nebula.widgets.nattable.config.IEditableRule;
49 45
import org.eclipse.nebula.widgets.nattable.data.IRowIdAccessor;
50 46
import org.eclipse.nebula.widgets.nattable.data.ListDataProvider;
51
import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
52 47
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer;
53 48
import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsSortModel;
54 49
import org.eclipse.nebula.widgets.nattable.grid.GridRegion;
......
65 60
import org.eclipse.nebula.widgets.nattable.selection.RowSelectionProvider;
66 61
import org.eclipse.nebula.widgets.nattable.sort.SortHeaderLayer;
67 62
import org.eclipse.nebula.widgets.nattable.sort.config.SingleClickSortConfiguration;
68
import org.eclipse.nebula.widgets.nattable.style.DisplayMode;
69 63
import org.eclipse.nebula.widgets.nattable.style.theme.ModernNatTableThemeConfiguration;
70 64
import org.eclipse.nebula.widgets.nattable.ui.binding.UiBindingRegistry;
71 65
import org.eclipse.nebula.widgets.nattable.ui.matcher.MouseEventMatcher;
......
92 86
import eu.etaxonomy.cdm.model.taxon.Taxon;
93 87
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
94 88
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorQuery;
95
import eu.etaxonomy.taxeditor.bulkeditor.NullTextEditor;
96 89
import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
97 90
import eu.etaxonomy.taxeditor.bulkeditor.input.sortprovider.TitleCacheComparator;
98 91
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
......
228 221
                        configRegistry,
229 222
                        columnHeaderDataLayer));
230 223
        //row
231
        DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider);
232
        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
224
        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(new DataLayer(rowHeaderDataProvider, 50, 50),
225
//        DataLayer rowHeaderDataLayer = new DataLayer(rowHeaderDataProvider);
226
//        RowHeaderLayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer,
233 227
                bodyLayer, bodyLayer.getSelectionLayer());
234
        rowHeaderDataLayer.setDefaultRowHeight(20);
235
        rowHeaderDataLayer.setColumnWidthByPosition(0, 50);
236
        rowHeaderDataLayer.setColumnWidthByPosition(1, 200);
237
        rowHeaderDataLayer.setColumnWidthByPosition(2, 100);
228
//        rowHeaderDataLayer.setDefaultRowHeight(20);
229
//        rowHeaderDataLayer.setColumnWidthByPosition(0, 50);
230
//        rowHeaderDataLayer.setColumnWidthByPosition(1, 200);
231
//        rowHeaderDataLayer.setColumnWidthByPosition(2, 100);
238 232

  
239 233
        //corner
240 234
        DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
......
244 238
        //grid
245 239
        GridLayer gridLayer = new GridLayer(bodyLayer, sortHeaderLayer,
246 240
                rowHeaderLayer, cornerLayer);
247

  
241
        dataLayer.setColumnPercentageSizing(true);
248 242
        natTable = new NatTable(bottomComposite, gridLayer, false);
249 243
        natTable.setConfigRegistry(configRegistry);
250 244

  
......
296 290
        });
297 291

  
298 292
        //make cells editable to allow selecting the text
299
        natTable.addConfiguration(new AbstractRegistryConfiguration() {
300
            @Override
301
            public void configureRegistry(IConfigRegistry configRegistry) {
302
              //make cell editable
303
                configRegistry.registerConfigAttribute(
304
                        EditConfigAttributes.CELL_EDITABLE_RULE,
305
                        IEditableRule.ALWAYS_EDITABLE,
306
                        DisplayMode.EDIT);
307
                //register editor
308
                NullTextEditor nullTextEditor = new NullTextEditor();
309
                ContextInjectionFactory.inject(nullTextEditor, context);
310
                configRegistry.registerConfigAttribute(
311
                        EditConfigAttributes.CELL_EDITOR,
312
                        nullTextEditor,
313
                        DisplayMode.EDIT);
314
            }
315
        });
293
//        natTable.addConfiguration(new AbstractRegistryConfiguration() {
294
//            @Override
295
//            public void configureRegistry(IConfigRegistry configRegistry) {
296
//              //make cell editable
297
//                configRegistry.registerConfigAttribute(
298
//                        EditConfigAttributes.CELL_EDITABLE_RULE,
299
//                        IEditableRule.ALWAYS_EDITABLE,
300
//                        DisplayMode.EDIT);
301
//                //register editor
302
//                NullTextEditor nullTextEditor = new NullTextEditor();
303
//                ContextInjectionFactory.inject(nullTextEditor, context);
304
//                configRegistry.registerConfigAttribute(
305
//                        EditConfigAttributes.CELL_EDITOR,
306
//                        nullTextEditor,
307
//                        DisplayMode.EDIT);
308
//            }
309
//        });
316 310

  
317 311
        //enable sorting
318 312
        natTable.addConfiguration(new SingleClickSortConfiguration());

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)