<commit_before>/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.designer.internal.ui.views;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Shell;

/**
 * The dialog used to rename action's input
 */
public class RenameInputDialog extends InputDialog
{

	public RenameInputDialog( Shell shell, String dialogTitle,
			String dialogMessage, String initialValue, IInputValidator validator )
	{
		super( shell, dialogTitle, dialogMessage, initialValue, validator );
	}

	public int open( )
	{
		Button okButton = getButton( IDialogConstants.OK_ID );
		okButton.setEnabled( false );
		return super.open( );
	}
}<commit_msg>- Summary: The OK button is gray when insert a dimension in cube builder<commit_after>/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.designer.internal.ui.views;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IInputValidator;
import org.eclipse.jface.dialogs.InputDialog;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Shell;

/**
 * The dialog used to rename action's input
 */
public class RenameInputDialog extends InputDialog
{

	public RenameInputDialog( Shell shell, String dialogTitle,
			String dialogMessage, String initialValue, IInputValidator validator )
	{
		super( shell, dialogTitle, dialogMessage, initialValue, validator );
	}

	public int open( )
	{
		getText( ).addModifyListener( new ModifyListener( ) {

			public void modifyText( ModifyEvent e )
			{
				if ( getText( ).getText( ).trim( ).length( ) == 0 )
					getButton( IDialogConstants.OK_ID ).setEnabled( false );
				else
					getButton( IDialogConstants.OK_ID ).setEnabled( true );
			}

		} );
		if ( getText( ).getText( ).trim( ).length( ) == 0 )
			getButton( IDialogConstants.OK_ID ).setEnabled( false );
		return super.open( );
	}
}
{'fraction_non_alphanumeric': 0.19202075900097307, 'fraction_numerical': 0.005838469023678235, 'mean_word_length': 4.942196531791907, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2776278', 'n_tokens_mistral': 896, 'n_tokens_neox': 813, 'n_words': 237}