ASF Bugzilla – Attachment 30542 Details for
Bug 55202
Add syntax color for scripts elements (BeanShell, BSF, and JSR223) and JDBC elements with RSyntaxTextArea
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for GenericTestBeanCusomizer.java
GenericTestBeanCustomizer.java.diff (text/plain), 3.51 KB, created by
Marko
on 2013-07-05 17:58:12 UTC
(
hide
)
Description:
Patch for GenericTestBeanCusomizer.java
Filename:
MIME Type:
Creator:
Marko
Created:
2013-07-05 17:58:12 UTC
Size:
3.51 KB
patch
obsolete
>Index: src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java >=================================================================== >--- src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (revision 1496951) >+++ src/core/org/apache/jmeter/testbeans/gui/GenericTestBeanCustomizer.java (working copy) >@@ -21,6 +21,7 @@ > import java.awt.GridBagLayout; > import java.awt.Insets; > import java.beans.BeanInfo; >+import java.beans.PropertyChangeListener; > import java.beans.PropertyDescriptor; > import java.beans.PropertyEditor; > import java.beans.PropertyEditorManager; >@@ -203,6 +204,8 @@ > > // Obtain the propertyEditors: > editors = new PropertyEditor[descriptors.length]; >+ int scriptLanguageIndex=0; >+ int textAreaEditorIndex=0; > for (int i = 0; i < descriptors.length; i++) { // Index is also used for accessing editors array > PropertyDescriptor descriptor = descriptors[i]; > String name = descriptor.getName(); >@@ -218,7 +221,7 @@ > PropertyEditor propertyEditor; > Object guiType = descriptor.getValue(GUITYPE); > if (guiType instanceof TypeEditor) { >- propertyEditor = ((TypeEditor) guiType).getInstance(descriptor); >+ propertyEditor = ((TypeEditor) guiType).getInstance(descriptor); > } else { > Class<?> editorClass = descriptor.getPropertyEditorClass(); > if (log.isDebugEnabled()) { >@@ -267,6 +270,11 @@ > { > ((TestBeanPropertyEditor)propertyEditor).setDescriptor(descriptor); > } >+ >+ if (propertyEditor instanceof TextAreaEditor) >+ { >+ textAreaEditorIndex = i; >+ } > if (propertyEditor.getCustomEditor() instanceof JScrollPane) { > scrollerCount++; > } >@@ -275,9 +283,19 @@ > > // Initialize the editor with the provided default value or null: > setEditorValue(i, descriptor.getValue(DEFAULT)); >+ >+ if (name.equals("scriptLanguage")){ >+ scriptLanguageIndex=i; >+ } > > } >- >+ // In case of BSF and JSR elements i want to add textAreaEditor as a listener to scriptLanguage ComboBox. >+ String beanName = this.beanInfo.getBeanDescriptor().getName(); >+ if (beanName.startsWith("BSF") || beanName.startsWith("JSR223")){ >+ WrapperEditor we = (WrapperEditor) editors[scriptLanguageIndex]; >+ TextAreaEditor tae = (TextAreaEditor) editors[textAreaEditorIndex]; >+ we.addChangeListener(tae); >+ } > // Obtain message formats: > propertyFieldLabelMessage = new MessageFormat(JMeterUtils.getResString("property_as_field_label")); //$NON-NLS-1$ > propertyToolTipMessage = new MessageFormat(JMeterUtils.getResString("property_tool_tip")); //$NON-NLS-1$ >@@ -350,7 +368,7 @@ > tags[j++] = additionalTag; > } > } >- >+ > boolean notNull = notNull(descriptor); > boolean notExpression = notExpression(descriptor); > boolean notOther = notOther(descriptor); >@@ -363,7 +381,7 @@ > e.setNoUndefined(notNull); > e.setNoEdit(notExpression && notOther); > e.setTags(tags); >- >+ > guiEditor = e; > } > >@@ -372,7 +390,6 @@ > !notExpression, // acceptsExpressions > !notOther, // acceptsOther > descriptor.getValue(DEFAULT)); >- > return wrapper; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55202
:
30540
|
30541
|
30542
|
30543
|
30544
|
30545
|
30546
|
30547
|
30548
|
30549
|
30550