@@ -276,6 +276,10 @@ public boolean getSaveAction()
276276 */
277277 public void markDirty ()
278278 {
279+ @ SuppressWarnings ("unchecked" )
280+ List <NvsTableBean > beansToSave = (List <NvsTableBean >) tableViewer .getInput ();
281+ validateBeansBeforeSaving (beansToSave );
282+ updateErrorMessage ();
279283 dirtyStateListener .accept (true );
280284 }
281285
@@ -534,6 +538,17 @@ public String getColumnText(NvsTableBean bean)
534538 {
535539 return bean .getKey ();
536540 }
541+
542+ @ Override
543+ public String getToolTipText (Object element )
544+ {
545+ if (tableViewer .getElementAt (0 ).equals (element ))
546+ {
547+
548+ return Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg ;
549+ }
550+ return super .getToolTipText (element );
551+ }
537552 });
538553 colKey .setEditingSupport (new EditingSupport (tableViewer )
539554 {
@@ -577,6 +592,28 @@ public String getColumnText(NvsTableBean bean)
577592 {
578593 return bean .getType ();
579594 }
595+
596+ @ Override
597+ public String getToolTipText (Object element )
598+ {
599+ if (tableViewer .getElementAt (0 ).equals (element ))
600+ {
601+
602+ return Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg ;
603+ }
604+ return super .getToolTipText (element );
605+ }
606+
607+ @ Override
608+ public Color getBackground (Object element )
609+ {
610+ if (tableViewer .getElementAt (0 ).equals (element ))
611+ {
612+ return Display .getCurrent ().getSystemColor (SWT .COLOR_WIDGET_LIGHT_SHADOW );
613+ }
614+ return null ;
615+ }
616+
580617 });
581618 colType .setEditingSupport (new EditingSupport (tableViewer )
582619 {
@@ -587,11 +624,6 @@ protected CellEditor getCellEditor(Object element)
587624
588625 protected boolean canEdit (Object element )
589626 {
590- if (tableViewer .getElementAt (0 ).equals (element ))
591- {
592- setMessage (Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg , IMessageProvider .INFORMATION );
593- return false ;
594- }
595627 return true ;
596628 }
597629
@@ -646,6 +678,27 @@ public String getColumnText(NvsTableBean bean)
646678 {
647679 return bean .getEncoding ();
648680 }
681+
682+ @ Override
683+ public String getToolTipText (Object element )
684+ {
685+ if (tableViewer .getElementAt (0 ).equals (element ))
686+ {
687+
688+ return Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg ;
689+ }
690+ return super .getToolTipText (element );
691+ }
692+
693+ @ Override
694+ public Color getBackground (Object element )
695+ {
696+ if (tableViewer .getElementAt (0 ).equals (element ))
697+ {
698+ return Display .getCurrent ().getSystemColor (SWT .COLOR_WIDGET_LIGHT_SHADOW );
699+ }
700+ return null ;
701+ }
649702 });
650703 colEncoding .setEditingSupport (new EditingSupport (tableViewer )
651704 {
@@ -658,18 +711,7 @@ protected CellEditor getCellEditor(Object element)
658711
659712 protected boolean canEdit (Object element )
660713 {
661- if (tableViewer .getElementAt (0 ).equals (element ))
662- {
663- setMessage (Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg , IMessageProvider .INFORMATION );
664- return false ;
665- }
666- NvsTableBean bean = (NvsTableBean ) element ;
667- boolean isCellEditable = !bean .getType ().contentEquals ("namespace" ); //$NON-NLS-1$
668- if (!isCellEditable )
669- {
670- setMessage (Messages .NvsEditorDialog_NamespaceEditLimitationInfoMsg , IMessageProvider .INFORMATION );
671- }
672- return isCellEditable ;
714+ return true ;
673715 }
674716
675717 protected Object getValue (Object element )
@@ -715,6 +757,27 @@ public String getColumnText(NvsTableBean bean)
715757 {
716758 return bean .getValue ();
717759 }
760+
761+ @ Override
762+ public String getToolTipText (Object element )
763+ {
764+ if (tableViewer .getElementAt (0 ).equals (element ))
765+ {
766+
767+ return Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg ;
768+ }
769+ return super .getToolTipText (element );
770+ }
771+
772+ @ Override
773+ public Color getBackground (Object element )
774+ {
775+ if (tableViewer .getElementAt (0 ).equals (element ))
776+ {
777+ return Display .getCurrent ().getSystemColor (SWT .COLOR_WIDGET_LIGHT_SHADOW );
778+ }
779+ return null ;
780+ }
718781 });
719782 colValue .setEditingSupport (new EditingSupport (tableViewer )
720783 {
@@ -725,18 +788,7 @@ protected CellEditor getCellEditor(Object element)
725788
726789 protected boolean canEdit (Object element )
727790 {
728- if (tableViewer .getElementAt (0 ).equals (element ))
729- {
730- setMessage (Messages .NvsEditorDialog_FirstRowIsFixedInfoMsg , IMessageProvider .INFORMATION );
731- return false ;
732- }
733- NvsTableBean bean = (NvsTableBean ) element ;
734- boolean isCellEditable = !bean .getType ().contentEquals ("namespace" ); //$NON-NLS-1$
735- if (!isCellEditable )
736- {
737- setMessage (Messages .NvsEditorDialog_NamespaceEditLimitationInfoMsg , IMessageProvider .INFORMATION );
738- }
739- return isCellEditable ;
791+ return true ;
740792 }
741793
742794 protected Object getValue (Object element )
0 commit comments