1 20 21 package org.apache.directory.ldapstudio.valueeditors.address; 22 23 24 import org.apache.directory.ldapstudio.browser.common.dialogs.TextDialog; 25 import org.apache.directory.ldapstudio.browser.core.model.IValue; 26 import org.apache.directory.ldapstudio.valueeditors.AbstractDialogStringValueEditor; 27 import org.eclipse.swt.widgets.Shell; 28 29 30 39 public class AddressValueEditor extends AbstractDialogStringValueEditor 40 { 41 42 47 protected boolean openDialog( Shell shell ) 48 { 49 Object value = getValue(); 50 if ( value != null && value instanceof String ) 51 { 52 AddressDialog dialog = new AddressDialog( shell, ( String ) value ); 53 if ( dialog.open() == TextDialog.OK && !"".equals( dialog.getText() ) ) 54 { 55 setValue( dialog.getText() ); 56 return true; 57 } 58 } 59 return false; 60 } 61 62 63 68 public String getDisplayValue( IValue value ) 69 { 70 String displayValue = super.getDisplayValue( value ); 71 72 if ( !showRawValues() ) 73 { 74 displayValue = displayValue.replaceAll( "\\$", ", " ); 75 } 76 77 return displayValue; 78 } 79 80 } 81 | Popular Tags |