public void setSelectedFunction( final FunctionDescription selectedFunction ) { this.selectedFunction = selectedFunction; if ( selectedFunction == null ) { this.functionDescription.setText( "" ); this.functionReturnType.setText( "" ); } else { this.functionDescription.setText( selectedFunction.getDescription( Locale.getDefault() ) ); this.functionReturnType.setText( TypeUtil.getParameterType( selectedFunction.getValueType(), getLocale() ) ); } repaint(); } }
public Component getListCellRendererComponent( final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus ) { super.getListCellRendererComponent( list, value, index, isSelected, cellHasFocus ); if ( value instanceof FunctionDescription ) { final FunctionDescription cat = (FunctionDescription) value; setText( cat.getDisplayName( Locale.getDefault() ) ); setToolTipText( cat.getDescription( Locale.getDefault() ) ); } else { setText( " " ); // NON-NLS setToolTipText( null ); } return this; } }
try { assertNotNull( data.getCategory() ); assertNotNull( data.getDescription( Locale.ENGLISH ) ); assertNotNull( data.getDisplayName( Locale.ENGLISH ) ); assertNotNull( data.getValueType() );
protected void performTranslationTest( String function ) { FunctionDescription functionDesc = context.getFunctionRegistry().getMetaData( function ); assertFalse( StringUtils.isEmpty( functionDesc.getDisplayName( Locale.ENGLISH ) ) ); assertFalse( StringUtils.isEmpty( functionDesc.getDescription( Locale.ENGLISH ) ) ); int count = functionDesc.getParameterCount(); for ( int x = 0; x < count; x++ ) { assertFalse( StringUtils.isEmpty( functionDesc.getParameterDescription( x, Locale.ENGLISH ) ) ); assertFalse( StringUtils.isEmpty( functionDesc.getParameterDisplayName( x, Locale.ENGLISH ) ) ); } } }
public void testTranslationsAvailable() { FunctionRegistry registry = context.getFunctionRegistry(); String[] functions = registry.getFunctionNames(); for ( int i = 0; i < functions.length; i++ ) { String function = functions[ i ]; FunctionDescription functionDesc = registry.getMetaData( function ); assertFalse( StringUtils.isEmpty( functionDesc.getDisplayName( Locale.ENGLISH ) ) ); assertFalse( StringUtils.isEmpty( functionDesc.getDescription( Locale.ENGLISH ) ) ); int count = functionDesc.getParameterCount(); for ( int x = 0; x < count; x++ ) { assertFalse( StringUtils.isEmpty( functionDesc.getParameterDescription( x, Locale.ENGLISH ) ) ); assertFalse( StringUtils.isEmpty( functionDesc.getParameterDisplayName( x, Locale.ENGLISH ) ) ); } } } }