Package de.innovationgate.eclipse.utils.ui.model

Examples of de.innovationgate.eclipse.utils.ui.model.BeanListTableModelCellModifier


       
        createColumns();
       
        _tableViewer = new TableViewer(_table);
       
        _cellModifier = new BeanListTableModelCellModifier(_tableViewer, _model);
        _tableViewer.setCellModifier(_cellModifier);
       
        _tableViewer.setContentProvider(new BeanListTableModelContentProvider());
        _tableViewer.setLabelProvider(new BeanListTableModelLabelProvider(_model));
        _tableViewer.setInput(_model)
View Full Code Here


        CellEditor[] editors = new CellEditor[2];
        editors[0] = new TextCellEditor(_tblACLRoles);       
        editors[1] = new CheckboxCellEditor(_tblACLRoles);
        _tblViewerACLRoles.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerACLRoles, _aclRolesModel);       
        modifier.setEditMode(1, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);       
        _tblViewerACLRoles.setCellModifier(modifier);  
        _tblViewerACLRoles.setContentProvider(new BeanListTableModelContentProvider());
        _tblViewerACLRoles.setLabelProvider(new BeanListTableModelLabelProvider(_aclRolesModel));
        _tblViewerACLRoles.setInput(_aclRolesModel)
       
View Full Code Here

        editors[3] = new TextCellEditor(_tblShortcuts);
        editors[4] = new TextCellEditor(_tblShortcuts);
       
        _tblViewerShortcuts.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerShortcuts, _shortcutsModel);       
        modifier.setEditMode(1, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);       
        _tblViewerShortcuts.setCellModifier(modifier);  
        modifier.setValueMapper(1, new BeanListTableModelValueMapper() {

      public Object map(Object element, String property, Object value) {
        return  _shortcutTypesByIndex.get((Integer) value).getKey();
      }
         
View Full Code Here

        editors[1] = new TextCellEditor(_tblMediaKeys);
        editors[2] = new CheckboxCellEditor(_tblMediaKeys, SWT.CENTER);       
        editors[3] = new CheckboxCellEditor(_tblMediaKeys, SWT.CENTER);
        _tblViewerMediaKeys.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerMediaKeys, _mediaKeysModel);
        modifier.setEditMode(2, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);
        modifier.setEditMode(3, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);
        _tblViewerMediaKeys.setCellModifier(modifier);
       
        _tblViewerMediaKeys.setContentProvider(new BeanListTableModelContentProvider());
        _tblViewerMediaKeys.setLabelProvider(new BeanListTableModelLabelProvider(_mediaKeysModel));
        _tblViewerMediaKeys.setInput(_mediaKeysModel)
       

        _btnAddMediaKey = toolkit.createButton(sectionClient, "add", SWT.PUSH);
        _btnAddMediaKey.setLayoutData(btnLayout);
        _btnAddMediaKey.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddMediaKey();
      }

    });
       
        _btnRemoveMediaKey = toolkit.createButton(sectionClient, "remove", SWT.PUSH);
        _btnRemoveMediaKey.setLayoutData(btnLayout);
        _btnRemoveMediaKey.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemoveMediaKey();
      }
    });
       
    // encoder section
    section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.COMPACT);
    section.setText("Encoder Mappings");

        sectionClient = toolkit.createComposite(section);
        sectionClient.setLayout(sectionLayout);
        section.setClient(sectionClient);
       
        // create Table encoder mappings
        _tblEncoderMappings = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblEncoderMappings.setHeaderVisible(true);                 
        _tblEncoderMappings.setLayoutData(GridDataFactory.copyData(tblLayoutData));   
        registerField("encoderMappings", _tblEncoderMappings);
         
        _encoderNameColumn = new TableColumn(_tblEncoderMappings, SWT.NONE)
        _encoderNameColumn.setText("Encoder name");
        _encoderNameColumn.setWidth((int)(tableWidth * 0.5));
       
        _encoderImplClassColumn = new TableColumn(_tblEncoderMappings, SWT.NONE);
        _encoderImplClassColumn.setText("Implementation class");
        _encoderImplClassColumn.setWidth((int)(tableWidth * 0.5));         

        _encoderMappingsModel = new EncoderMappingsModel(_model.getEncoderMappings());
        _encoderMappingsModel.addListener(new BeanListTableModelListener() {

      public void add(Object bean) {
        _model.fireModelChanged();         
      }

      public void remove(Object bean) {
        _model.fireModelChanged();       
      }

      public void update(Object bean) {
        _model.fireModelChanged();         
      }     

      @SuppressWarnings("unchecked")
      public void refresh(List beans) {
        _model.fireModelChanged();       
      }
         
        });
       
        _tblViewerEncoderMappings = new TableViewer(_tblEncoderMappings);
       
        // text editors for both columns
        editors = new CellEditor[2];
        editors[0] = new TextCellEditor(_tblEncoderMappings);
        editors[1] = new TextCellEditor(_tblEncoderMappings);         
        _tblViewerEncoderMappings.setCellEditors(editors);
       
        _tblViewerEncoderMappings.setCellModifier(new BeanListTableModelCellModifier(_tblViewerEncoderMappings, _encoderMappingsModel));                                       
        _tblViewerEncoderMappings.setContentProvider(new BeanListTableModelContentProvider());
        _tblViewerEncoderMappings.setLabelProvider(new BeanListTableModelLabelProvider(_encoderMappingsModel));
        _tblViewerEncoderMappings.setInput(_encoderMappingsModel)
       
        _btnAddEncoderMapping = toolkit.createButton(sectionClient, "add", SWT.PUSH);
        _btnAddEncoderMapping.setLayoutData(btnLayout);
        _btnAddEncoderMapping.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleAddEncoderMapping();
      }

    });
       
        _btnRemoveEncoderMapping = toolkit.createButton(sectionClient, "remove", SWT.PUSH);
        _btnRemoveEncoderMapping.setLayoutData(btnLayout);
      _btnRemoveEncoderMapping.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
      public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
        handleRemoveEncoderMapping();
      }
    });

     
      // element section
    section = toolkit.createSection(form.getBody(), Section.DESCRIPTION|Section.TITLE_BAR|Section.TWISTIE|Section.COMPACT);
    section.setText("Element Mappings");

        sectionClient = toolkit.createComposite(section);
        section.setClient(sectionClient);     
        sectionLayout.numColumns = 2;
        sectionClient.setLayout(sectionLayout);   
       
        // create Table element mappings
        _tblElementMappings = toolkit.createTable(sectionClient, SWT.BORDER|SWT.FULL_SELECTION);
        _tblElementMappings.setHeaderVisible(true);         
        _tblElementMappings.setLayoutData(GridDataFactory.copyData(tblLayoutData))
        registerField("elementMappings", _tblElementMappings);
               
        _elementNameColumn = new TableColumn(_tblElementMappings, SWT.NONE)
        _elementNameColumn.setText("Element name");
        _elementNameColumn.setWidth((int)(tableWidth * 0.5));
       
        _elementImplClassColumn = new TableColumn(_tblElementMappings, SWT.NONE);
        _elementImplClassColumn.setText("Implementation class");
        _elementImplClassColumn.setWidth((int)(tableWidth * 0.5));         

        _elementMappingsModel = new ElementMappingsModel(_model.getElementMappings());
        _elementMappingsModel.addListener(new BeanListTableModelListener() {

      public void add(Object bean) {
        _model.fireModelChanged();         
      }

      public void remove(Object bean) {
        _model.fireModelChanged();       
      }

      public void update(Object bean) {
        _model.fireModelChanged();         
      }
     
      @SuppressWarnings("unchecked")
      public void refresh(List beans) {
        _model.fireModelChanged();       
      }
         
        });
       
        _tblViewerElementMappings = new TableViewer(_tblElementMappings);
       
        // text editors for both columns
        editors = new CellEditor[2];
        editors[0] = new TextCellEditor(_tblElementMappings);
        editors[1] = new TextCellEditor(_tblElementMappings);         
        _tblViewerElementMappings.setCellEditors(editors);
       
        _tblViewerElementMappings.setCellModifier(new BeanListTableModelCellModifier(_tblViewerElementMappings, _elementMappingsModel));                                       
        _tblViewerElementMappings.setContentProvider(new BeanListTableModelContentProvider());
        _tblViewerElementMappings.setLabelProvider(new BeanListTableModelLabelProvider(_elementMappingsModel));
        _tblViewerElementMappings.setInput(_elementMappingsModel)
       

View Full Code Here

        editors[1] = new ComboBoxCellEditor(_tblRemoteActions, accessLevelValues.toArray(new String[0]), SWT.READ_ONLY);
       
        editors[2] = new TextCellEditor(_tblRemoteActions);         
        _tblViewerRemoteActions.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerRemoteActions, _remoteActionsModel);       
        modifier.setEditMode(1, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);       
        _tblViewerRemoteActions.setCellModifier(modifier);  
        modifier.setValueMapper(1, new BeanListTableModelValueMapper() {

      public Object map(Object element, String property, Object value) {
          if ((Integer)value == -1) {
              value = 0;
          }
View Full Code Here

          CellEditor[] editors = new CellEditor[2];
          editors[0] = new TextCellEditor(_tblDependencies);
          editors[1] = new TextCellEditor(_tblDependencies);         
          _tblViewerPluginDependencies.setCellEditors(editors);
         
          _tblViewerPluginDependencies.setCellModifier(new BeanListTableModelCellModifier(_tblViewerPluginDependencies, _pluginDependenciesModel));                                       
          _tblViewerPluginDependencies.setContentProvider(new BeanListTableModelContentProvider());
          _tblViewerPluginDependencies.setLabelProvider(new BeanListTableModelLabelProvider(_pluginDependenciesModel));
          _tblViewerPluginDependencies.setInput(_pluginDependenciesModel);
               
View Full Code Here

        editors[1] = new ComboBoxCellEditor(_tblRemoteActions, accessLevelValues.toArray(new String[0]), SWT.READ_ONLY);
       
        editors[2] = new TextCellEditor(_tblRemoteActions);         
        _tblViewerRemoteActions.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerRemoteActions, _remoteActionsModel);       
        modifier.setEditMode(1, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);       
        _tblViewerRemoteActions.setCellModifier(modifier);  
        modifier.setValueMapper(1, new BeanListTableModelValueMapper() {

      public Object map(Object element, String property, Object value) {
        return  _accessLevelByIndex.get((Integer) value).getKey();
      }
         
View Full Code Here

        editors[3] = new TextCellEditor(_tblJobDefinitions);
        editors[4] = new TextCellEditor(_tblJobDefinitions);
       
        _tblViewerJobDefinitions.setCellEditors(editors);
       
        BeanListTableModelCellModifier modifier = new BeanListTableModelCellModifier(_tblViewerJobDefinitions, _jobDefinitionsModel);       
        modifier.setEditMode(1, BeanListTableModelCellModifier.EDIT_MODE_ON_SINGLE_CLICK);       
        _tblViewerJobDefinitions.setCellModifier(modifier);  
        modifier.setValueMapper(1, new BeanListTableModelValueMapper() {

      public Object map(Object element, String property, Object value) {
        return  _jobTypesByIndex.get((Integer) value).getKey();
      }
         
View Full Code Here

TOP

Related Classes of de.innovationgate.eclipse.utils.ui.model.BeanListTableModelCellModifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.