<commit_before>
package org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts;

import org.eclipse.birt.report.designer.internal.ui.editors.schematic.figures.LabelFigure;
import org.eclipse.birt.report.designer.internal.ui.editors.schematic.figures.TextFigure;
import org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler;
import org.eclipse.birt.report.designer.nls.Messages;
import org.eclipse.birt.report.designer.ui.dialogs.BindingExpressionProvider;
import org.eclipse.birt.report.designer.ui.dialogs.ExpressionBuilder;
import org.eclipse.birt.report.model.api.TextDataHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.api.util.StringUtil;
import org.eclipse.draw2d.IFigure;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.ui.PlatformUI;

public class TextDataEditPart extends LabelEditPart
{

	private static final String FIGURE_DEFAULT_TEXT = Messages.getString( "TextDataEditPart.Figure.Dafault" ); //$NON-NLS-1$

	public TextDataEditPart( Object model )
	{
		super( model );
	}

	/**
	 * Popup the builder for Data element
	 */
	public void performDirectEdit( )
	{
		TextDataHandle handle = (TextDataHandle) getModel( );

		ExpressionBuilder dialog = new ExpressionBuilder( PlatformUI.getWorkbench( )
				.getDisplay( )
				.getActiveShell( ),
				handle.getValueExpr( ) );

		dialog.setExpressionProvier( new BindingExpressionProvider( handle ) );
		if ( dialog.open( ) == Dialog.OK )
		{
			try
			{
				( (TextDataHandle) getModel( ) ).setValueExpr( dialog.getResult( ) );
			}
			catch ( SemanticException e )
			{
				ExceptionHandler.handle( e );
				return;
			}
			refreshVisuals( );
		}
	}

	/*
	 * (non-Javadoc)<commit_msg>- Summary:fix 140746 Available data sets in dynamic text is error<commit_after>
package org.eclipse.birt.report.designer.internal.ui.editors.schematic.editparts;

import java.util.List;

import org.eclipse.birt.report.designer.internal.ui.editors.schematic.figures.LabelFigure;
import org.eclipse.birt.report.designer.internal.ui.editors.schematic.figures.TextFigure;
import org.eclipse.birt.report.designer.internal.ui.util.ExceptionHandler;
import org.eclipse.birt.report.designer.nls.Messages;
import org.eclipse.birt.report.designer.ui.dialogs.BindingExpressionProvider;
import org.eclipse.birt.report.designer.ui.dialogs.ExpressionBuilder;
import org.eclipse.birt.report.designer.ui.dialogs.ExpressionProvider;
import org.eclipse.birt.report.model.api.TextDataHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException;
import org.eclipse.birt.report.model.api.util.StringUtil;
import org.eclipse.draw2d.IFigure;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.ui.PlatformUI;

public class TextDataEditPart extends LabelEditPart
{

	private static final String FIGURE_DEFAULT_TEXT = Messages.getString( "TextDataEditPart.Figure.Dafault" ); //$NON-NLS-1$

	public TextDataEditPart( Object model )
	{
		super( model );
	}

	/**
	 * Popup the builder for Data element
	 */
	public void performDirectEdit( )
	{
		TextDataHandle handle = (TextDataHandle) getModel( );

		ExpressionBuilder dialog = new ExpressionBuilder( PlatformUI.getWorkbench( )
				.getDisplay( )
				.getActiveShell( ),
				handle.getValueExpr( ) );

		dialog.setExpressionProvier( new ExpressionProvider( handle ) );

		if ( dialog.open( ) == Dialog.OK )
		{
			try
			{
				( (TextDataHandle) getModel( ) ).setValueExpr( dialog.getResult( ) );
			}
			catch ( SemanticException e )
			{
				ExceptionHandler.handle( e );
				return;
			}
			refreshVisuals( );
		}
	}

	/*
	 * (non-Javadoc)
{'fraction_non_alphanumeric': 0.11782477341389729, 'fraction_numerical': 0.0027464982147761604, 'mean_word_length': 4.476691729323308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1925610', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1162, 'n_words': 187}