directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r518328 - in /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor: EntryEditorWidgetCellModifier.java EntryEditorWidgetContentProvider.java
Date Wed, 14 Mar 2007 21:21:22 GMT
Author: seelmann
Date: Wed Mar 14 14:21:21 2007
New Revision: 518328

URL: http://svn.apache.org/viewvc?view=rev&rev=518328
Log:
Fixed NPE.

Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java?view=diff&rev=518328&r1=518327&r2=518328
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
Wed Mar 14 14:21:21 2007
@@ -70,7 +70,7 @@
      */
     public boolean canModify( Object element, String property )
     {
-        if ( element != null && element instanceof IValue )
+        if ( element != null && element instanceof IValue && valueEditorManager
!= null )
         {
             IValue attributeValue = ( IValue ) element;
 
@@ -101,7 +101,7 @@
      */
     public Object getValue( Object element, String property )
     {
-        if ( element != null && element instanceof IValue )
+        if ( element != null && element instanceof IValue && valueEditorManager
!= null )
         {
             IValue attributeValue = ( IValue ) element;
             Object returnValue;
@@ -139,7 +139,7 @@
             element = ( ( Item ) element ).getData();
         }
 
-        if ( element != null && element instanceof IValue )
+        if ( element != null && element instanceof IValue && valueEditorManager
!= null )
         {
             IValue attributeValue = ( IValue ) element;
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java?view=diff&rev=518328&r1=518327&r2=518328
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java
Wed Mar 14 14:21:21 2007
@@ -73,37 +73,39 @@
      */
     public void inputChanged( Viewer viewer, Object oldInput, Object newInput )
     {
-
-        String dn = "";
-        boolean enabled = true;
-
-        if ( newInput != null && newInput instanceof IEntry )
-        {
-            IEntry entry = ( IEntry ) newInput;
-            dn = "DN: " + entry.getDn().toString();
-        }
-        else if ( newInput != null && newInput instanceof AttributeHierarchy )
-        {
-            AttributeHierarchy ah = ( AttributeHierarchy ) newInput;
-            dn = "DN: " + ah.getAttribute().getEntry().getDn().toString();
-        }
-        else
+        if ( mainWidget != null )
         {
-            dn = "No entry selected";
-            enabled = false;
-        }
+            String dn = "";
+            boolean enabled = true;
 
-        if ( mainWidget.getInfoText() != null && !mainWidget.getInfoText().isDisposed()
)
-        {
-            mainWidget.getInfoText().setText( dn );
-        }
-        if ( mainWidget.getQuickFilterWidget() != null )
-        {
-            mainWidget.getQuickFilterWidget().setEnabled( enabled );
-        }
-        if ( mainWidget.getViewer() != null && !mainWidget.getViewer().getTree().isDisposed()
)
-        {
-            mainWidget.getViewer().getTree().setEnabled( enabled );
+            if ( newInput != null && newInput instanceof IEntry )
+            {
+                IEntry entry = ( IEntry ) newInput;
+                dn = "DN: " + entry.getDn().toString();
+            }
+            else if ( newInput != null && newInput instanceof AttributeHierarchy
)
+            {
+                AttributeHierarchy ah = ( AttributeHierarchy ) newInput;
+                dn = "DN: " + ah.getAttribute().getEntry().getDn().toString();
+            }
+            else
+            {
+                dn = "No entry selected";
+                enabled = false;
+            }
+
+            if ( mainWidget.getInfoText() != null && !mainWidget.getInfoText().isDisposed()
)
+            {
+                mainWidget.getInfoText().setText( dn );
+            }
+            if ( mainWidget.getQuickFilterWidget() != null )
+            {
+                mainWidget.getQuickFilterWidget().setEnabled( enabled );
+            }
+            if ( mainWidget.getViewer() != null && !mainWidget.getViewer().getTree().isDisposed()
)
+            {
+                mainWidget.getViewer().getTree().setEnabled( enabled );
+            }
         }
     }
 



Mime
View raw message