org.eclipse.debug.ui.StringVariableSelectionDialog Java Examples

The following examples show how to use org.eclipse.debug.ui.StringVariableSelectionDialog. 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 File: InputComponent.java    From corrosion with 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 File: SARLArgumentsTab.java    From sarl with 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 File: ScriptMainTab.java    From birt with 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 File: HiveTab.java    From neoscada with 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
Source File: CompilerWorkingDirectoryBlock.java    From xds-ide with 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) {
        otherIsEdited = true;
        fOtherDirText.insert(variableText);
        otherIsEdited = false;
        if (actionListener != null) {
            actionListener.actionPerformed(null);
        }
    }
}
 
Example #6
Source File: EditSdkToolPage.java    From xds-ide with 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 File: WorkingDirectoryBlock.java    From Pydev with 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 File: ControlUtils.java    From goclipse with 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 File: CommandInvocationEditor.java    From goclipse with 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 File: SpellingPreferenceBlock.java    From xds-ide with 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 File: LocationSelector.java    From xds-ide with 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 File: AbstractMainTab.java    From typescript.java with 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
Source File: SpellingConfigurationBlock.java    From Eclipse-Postfix-Code-Completion with 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 #14
Source File: ControlUtils.java    From goclipse with 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));
}