本文整理汇总了Java中org.eclipse.debug.ui.StringVariableSelectionDialog类的典型用法代码示例。如果您正苦于以下问题:Java StringVariableSelectionDialog类的具体用法?Java StringVariableSelectionDialog怎么用?Java StringVariableSelectionDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringVariableSelectionDialog类属于org.eclipse.debug.ui包,在下文中一共展示了StringVariableSelectionDialog类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: variablesPressed
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
public String variablesPressed() {
StringVariableSelectionDialog varDlg = new StringVariableSelectionDialog(getShell());
varDlg.open();
String variableExpression = varDlg.getVariableExpression();
String currentDestdir = getTextControl().getText();
if(variableExpression == null) {
return currentDestdir;
}
Point pt = getTextControl().getSelection();
String result = currentDestdir.substring(0, pt.x);
result = result.concat(variableExpression);
result = result.concat(currentDestdir.substring(pt.y, currentDestdir.length()));
return result;
}
示例2: createVariableButton
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
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;
}
示例3: chooseVariable
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
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 ();
}
}
示例4: selectVariable
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
private void selectVariable() {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
String variable = dialog.getVariableExpression();
if (variable != null) {
addVariable(variable);
}
}
示例5: handleBrowseVariables
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
void handleBrowseVariables(Shell shell)
{
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(shell);
dialog.open();
String variable = dialog.getVariableExpression();
if (variable != null) {
mScript.insert(variable);
}
}
示例6: createControl
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(1, true));
comp.setFont(parent.getFont());
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
setControl(comp);
Group group = new Group(comp, SWT.NONE);
group.setFont(parent.getFont());
group.setLayout(new GridLayout());
group.setLayoutData(new GridData(GridData.FILL_BOTH));
group.setText("Program arguments:");
argumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 40;
gd.widthHint = 100;
argumentsText.setLayoutData(gd);
argumentsText.setFont(parent.getFont());
argumentsText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
scheduleUpdateJob();
}
});
Button varsButton = createPushButton(group, "Variables...", null);
varsButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
varsButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
String variable = dialog.getVariableExpression();
if (variable != null) {
argumentsText.insert(variable);
}
}
});
}
示例7: handleWorkingDirVariablesButtonSelected
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
/**
* 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);
}
}
示例8: openStringVariableSelectionDialog
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
public static String openStringVariableSelectionDialog(StringVariableSelectionDialog dialog)
throws OperationCancellation {
dialog.open();
String result = dialog.getVariableExpression();
if(result == null) {
throw new OperationCancellation();
}
return result;
}
示例9: newValueFromCommandVariablesDialog
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
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;
}
示例10: handleVariablesButtonSelected
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
protected void handleVariablesButtonSelected() {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(fDictionaryPath.getShell());
if (dialog.open() == Window.OK)
fDictionaryPath.setText(fDictionaryPath.getText() + dialog.getVariableExpression());
}
示例11: getVariable
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
/**
* 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();
}
示例12: handleVariablesButtonSelected
import org.eclipse.debug.ui.StringVariableSelectionDialog; //导入依赖的package包/类
protected void handleVariablesButtonSelected() {
StringVariableSelectionDialog dialog= new StringVariableSelectionDialog(fDictionaryPath.getShell());
if (dialog.open() == Window.OK)
fDictionaryPath.setText(fDictionaryPath.getText() + dialog.getVariableExpression());
}