Java Code Examples for org.eclipse.debug.ui.StringVariableSelectionDialog

The following examples show how to use org.eclipse.debug.ui.StringVariableSelectionDialog. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: corrosion   Source File: InputComponent.java    License: Eclipse Public License 2.0 6 votes vote down vote up
public void createVariableSelection() {
	makeSpaceForButton();
	variableButton = new Button(container, SWT.NONE);
	variableButton.setText(Messages.LaunchUI_variables);
	variableButton.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
	variableButton.addSelectionListener(widgetSelectedAdapter(e -> {
		StringVariableSelectionDialog variableSelector = new StringVariableSelectionDialog(
				variableButton.getShell());
		int returnCode = variableSelector.open();
		String result = variableSelector.getVariableExpression();
		if (returnCode == 0 && result != null) {
			text.append(result);
			editListener.modifyText(null);
		}
	}));
}
 
Example 2
Source Project: sarl   Source File: SARLArgumentsTab.java    License: Apache License 2.0 6 votes vote down vote up
private void createSREArgsVariableButton(Group group) {
	final Button sreArgVariableButton = createPushButton(group, "", null); //$NON-NLS-1$
	sreArgVariableButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
	sreArgVariableButton.addSelectionListener(new SelectionAdapter() {
		@SuppressWarnings("synthetic-access")
		@Override
		public void widgetSelected(SelectionEvent event) {
			final StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
			dialog.open();
			final String variable = dialog.getVariableExpression();
			if (variable != null) {
				SARLArgumentsTab.this.sreArgumentsText.insert(variable);
			}
		}
	});
}
 
Example 3
Source Project: birt   Source File: ScriptMainTab.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private Button createVariableButton( Composite parent, String text,
		final Text source )
{
	Button button = createPushButton( parent, text, null );
	button.addSelectionListener( new SelectionAdapter( ) {

		public void widgetSelected( SelectionEvent evt )
		{
			StringVariableSelectionDialog dialog = new StringVariableSelectionDialog( source.getShell( ) );
			if ( dialog.open( ) == Window.OK )
				source.insert( dialog.getVariableExpression( ) );
		}

	} );

	return button;
}
 
Example 4
Source Project: neoscada   Source File: HiveTab.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected void chooseVariable ()
{
    final StringVariableSelectionDialog dlg = new StringVariableSelectionDialog ( getShell () );
    dlg.setDialogBoundsSettings ( getDialogBoundsSettings ( HiveTab.VARIABLE_SELECTION_DIALOG ), Dialog.DIALOG_PERSISTSIZE );
    if ( dlg.open () == Window.OK )
    {
        this.fileText.insert ( dlg.getVariableExpression () );
        makeDirty ();
    }
}
 
Example 5
/**
 * The working dir variables button has been selected
 */
private void handleWorkingDirVariablesButtonSelected() {
    StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
    dialog.open();
    String variableText = dialog.getVariableExpression();
    if (variableText != null) {
        otherIsEdited = true;
        fOtherDirText.insert(variableText);
        otherIsEdited = false;
        if (actionListener != null) {
            actionListener.actionPerformed(null);
        }
    }
}
 
Example 6
Source Project: xds-ide   Source File: EditSdkToolPage.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private String selectVar() {
    StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
    dialog.addVariableFilter(new StringVariableSelectionDialog.VariableFilter() {
        @Override
        public boolean isFiltered(IDynamicVariable var) {
            return !var.getName().startsWith("xds_"); //$NON-NLS-1$
        }
    });
    dialog.open();
    return dialog.getVariableExpression();
}
 
Example 7
Source Project: Pydev   Source File: WorkingDirectoryBlock.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * The working dir variables button has been selected
 */
private void handleWorkingDirVariablesButtonSelected() {
    StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
    dialog.open();
    String variableText = dialog.getVariableExpression();
    if (variableText != null) {
        fOtherWorkingText.insert(variableText);
    }
}
 
Example 8
Source Project: goclipse   Source File: ControlUtils.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public static String openStringVariableSelectionDialog(StringVariableSelectionDialog dialog)
		throws OperationCancellation {
	dialog.open();
	String result = dialog.getVariableExpression();
	if(result == null) {
		throw new OperationCancellation();
	}
	return result;
}
 
Example 9
Source Project: goclipse   Source File: CommandInvocationEditor.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected String newValueFromCommandVariablesDialog() throws OperationCancellation {
	StringVariableSelectionDialog variablesDialog = new StringVariableSelectionDialog(
		commandArgumentsField.getFieldControl().getShell());
	
	variablesDialog.setElements(variablesResolver.getVariables());
	
	String addedVar = ControlUtils.openStringVariableSelectionDialog(variablesDialog);
	return commandArgumentsField.getFieldValue() + addedVar;
}
 
Example 10
Source Project: xds-ide   Source File: SpellingPreferenceBlock.java    License: Eclipse Public License 1.0 4 votes vote down vote up
protected void handleVariablesButtonSelected() {
    StringVariableSelectionDialog dialog= new StringVariableSelectionDialog(fDictionaryPath.getShell());
    if (dialog.open() == Window.OK)
        fDictionaryPath.setText(fDictionaryPath.getText() + dialog.getVariableExpression());
}
 
Example 11
Source Project: xds-ide   Source File: LocationSelector.java    License: Eclipse Public License 1.0 4 votes vote down vote up
private void browseVariables() {
    StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(text.getShell());
    if (dialog.open() == Window.OK)
        text.insert(dialog.getVariableExpression());
}
 
Example 12
Source Project: typescript.java   Source File: AbstractMainTab.java    License: MIT License 4 votes vote down vote up
/**
 * Prompts the user to choose and configure a variable and returns the
 * resulting string, suitable to be used as an attribute.
 */
private String getVariable() {
	StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
	dialog.open();
	return dialog.getVariableExpression();
}
 
Example 13
protected void handleVariablesButtonSelected() {
	StringVariableSelectionDialog dialog= new StringVariableSelectionDialog(fDictionaryPath.getShell());
	if (dialog.open() == Window.OK)
		fDictionaryPath.setText(fDictionaryPath.getText() + dialog.getVariableExpression());
}
 
Example 14
Source Project: goclipse   Source File: ControlUtils.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public static String openStringVariableSelectionDialog(final Shell shell) throws OperationCancellation {
	return openStringVariableSelectionDialog(new StringVariableSelectionDialog(shell));
}