use of org.eclipse.jface.viewers.ComboViewer in project azure-tools-for-java by Microsoft.
the class CreateArmStorageAccountForm method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
setTitle("Create New Storage Account");
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "com.microsoft.azuretools.azureexplorer.storage_account_dialog");
Composite container = new Composite(parent, SWT.FILL);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 2;
gridLayout.marginBottom = 10;
container.setLayout(gridLayout);
GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = SWT.FILL;
// gridData.widthHint = 250;
container.setLayoutData(gridData);
nameLabel = new Label(container, SWT.LEFT);
nameLabel.setText("Name:");
nameTextField = new Text(container, SWT.LEFT | SWT.BORDER);
// gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
nameTextField.setLayoutData(gridDataForText(180));
subscriptionLabel = new Label(container, SWT.LEFT);
subscriptionLabel.setText("Subscription:");
subscriptionComboBox = new Combo(container, SWT.READ_ONLY);
subscriptionComboBox.setLayoutData(gridDataForText(180));
resourceGroupLabel = new Label(container, SWT.LEFT);
resourceGroupLabel.setText("Resource group:");
gridData = new GridData();
gridData.verticalAlignment = SWT.TOP;
resourceGroupLabel.setLayoutData(gridData);
final Composite composite = new Composite(container, SWT.NONE);
gridLayout = new GridLayout();
gridLayout.numColumns = 2;
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
// gridData.widthHint = 250;
composite.setLayout(gridLayout);
composite.setLayoutData(gridData);
createNewRadioButton = new Button(composite, SWT.RADIO);
createNewRadioButton.setText("Create new");
createNewRadioButton.setSelection(true);
resourceGrpField = new Text(composite, SWT.LEFT | SWT.BORDER);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
resourceGrpField.setLayoutData(gridData);
useExistingRadioButton = new Button(composite, SWT.RADIO);
useExistingRadioButton.setText("Use existing");
resourceGrpCombo = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
resourceGrpCombo.setLayoutData(gridData);
resourceGroupViewer = new ComboViewer(resourceGrpCombo);
resourceGroupViewer.setContentProvider(ArrayContentProvider.getInstance());
SelectionListener updateListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
updateResourceGroup();
}
};
createNewRadioButton.addSelectionListener(updateListener);
useExistingRadioButton.addSelectionListener(updateListener);
updateResourceGroup();
regionLabel = new Label(container, SWT.LEFT);
regionLabel.setText("Region:");
regionComboBox = new Combo(container, SWT.READ_ONLY);
regionComboBox.setLayoutData(gridDataForText(180));
kindLabel = new Label(container, SWT.LEFT);
kindLabel.setText("Account kind:");
kindCombo = new Combo(container, SWT.READ_ONLY);
kindCombo.setLayoutData(gridDataForText(180));
performanceLabel = new Label(container, SWT.LEFT);
performanceLabel.setText("Performance:");
performanceCombo = new Combo(container, SWT.READ_ONLY);
performanceCombo.setLayoutData(gridDataForText(180));
replicationLabel = new Label(container, SWT.LEFT);
replicationLabel.setText("Replication:");
replicationComboBox = new Combo(container, SWT.READ_ONLY);
replicationComboBox.setLayoutData(gridDataForText(180));
if (subscription == null) {
// not showing access tier with general purpose storage account which is used when creating vm
accessTierLabel = new Label(container, SWT.LEFT);
accessTierLabel.setText("Access Tier:");
accessTierComboBox = new Combo(container, SWT.READ_ONLY);
accessTierComboBox.setLayoutData(gridDataForText(180));
for (AccessTier type : AccessTier.values()) {
accessTierComboBox.add(type.toString());
accessTierComboBox.setData(type.toString(), type);
}
accessTierComboBox.select(0);
}
pricingLabel = new Link(container, SWT.LEFT);
pricingLabel.setText(PRICING_LINK);
gridData = new GridData();
gridData.horizontalSpan = 2;
pricingLabel.setLayoutData(gridData);
pricingLabel.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(event.text));
} catch (Exception ex) {
/*
* only logging the error in log file
* not showing anything to end user
*/
Activator.getDefault().log("Error occurred while opening link in default browser.", ex);
}
}
});
nameTextField.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent modifyEvent) {
validateEmptyFields();
}
});
regionComboBox.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
validateEmptyFields();
}
});
resourceGrpField.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent modifyEvent) {
validateEmptyFields();
}
});
resourceGrpCombo.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
validateEmptyFields();
}
});
fillFields();
return super.createDialogArea(parent);
}
use of org.eclipse.jface.viewers.ComboViewer in project azure-tools-for-java by Microsoft.
the class SettingsStep method createSettingsPanel.
private void createSettingsPanel(Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
composite.setLayout(gridLayout);
composite.setLayoutData(gridData);
resourceGrpLabel = new Label(composite, SWT.LEFT);
resourceGrpLabel.setText("Resource group:");
final Composite container = new Composite(composite, SWT.NONE);
gridLayout = new GridLayout();
gridLayout.numColumns = 2;
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = GridData.BEGINNING;
// gridData.grabExcessHorizontalSpace = true;
gridData.widthHint = 250;
container.setLayout(gridLayout);
container.setLayoutData(gridData);
createNewRadioButton = new Button(container, SWT.RADIO);
createNewRadioButton.setText("Create new");
resourceGrpField = new Text(container, SWT.LEFT | SWT.BORDER);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
resourceGrpField.setLayoutData(gridData);
useExistingRadioButton = new Button(container, SWT.RADIO);
useExistingRadioButton.setText("Use existing");
resourceGrpCombo = new Combo(container, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
resourceGrpCombo.setLayoutData(gridData);
resourceGroupViewer = new ComboViewer(resourceGrpCombo);
resourceGroupViewer.setContentProvider(ArrayContentProvider.getInstance());
SelectionListener updateListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
handleResourceGroup();
}
};
createNewRadioButton.addSelectionListener(updateListener);
useExistingRadioButton.addSelectionListener(updateListener);
createNewRadioButton.setSelection(true);
handleResourceGroup();
storageAccountLabel = new Label(composite, SWT.LEFT);
storageAccountLabel.setText("Storage account:");
storageComboBox = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
storageComboBox.setLayoutData(gridData);
networkLabel = new Label(composite, SWT.LEFT);
networkLabel.setText("Virtual Network:");
networkComboBox = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
networkComboBox.setLayoutData(gridData);
subnetLabel = new Label(composite, SWT.LEFT);
subnetLabel.setText("Subnet:");
subnetComboBox = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
subnetComboBox.setLayoutData(gridData);
pipLabel = new Label(composite, SWT.LEFT);
pipLabel.setText("Public IP address:");
pipCombo = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
pipCombo.setLayoutData(gridData);
nsgLabel = new Label(composite, SWT.LEFT);
nsgLabel.setText("Network security group (firewall):");
nsgCombo = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
nsgCombo.setLayoutData(gridData);
availabilityLabel = new Label(composite, SWT.LEFT);
availabilityLabel.setText("Availability set:");
availabilityCombo = new Combo(composite, SWT.READ_ONLY);
gridData = new GridData(SWT.FILL, SWT.CENTER, true, true);
availabilityCombo.setLayoutData(gridData);
}
use of org.eclipse.jface.viewers.ComboViewer in project tdi-studio-se by Talend.
the class MemoryRuntimeComposite method initContextInput.
@SuppressWarnings("unchecked")
private void initContextInput() {
List<IContext> contextList = (List<IContext>) viewPart.getContextComposite().getContextComboInput();
if (contextList != null) {
contextCombo.setSelection(new StructuredSelection(contextList.get(0)));
contextCombo.setInput(contextList);
ComboViewer processContextComboViewer = viewPart.getContextComposite().getContextComboViewer();
IContext selectedContext = (IContext) ((IStructuredSelection) processContextComboViewer.getSelection()).getFirstElement();
for (int i = 0; i < contextList.size(); i++) {
if (contextList.get(i).getName().equals(selectedContext.getName())) {
contextCombo.getCombo().select(i);
}
}
contextCombo.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
viewPart.getContextComposite().runSelectionChange(event);
}
});
} else {
contextCombo.getCombo().setEnabled(false);
}
}
use of org.eclipse.jface.viewers.ComboViewer in project tdi-studio-se by Talend.
the class LoginProjectPage method instantiateControl.
@Override
public void instantiateControl(Composite container) {
/**
* 1. Create all the control first
*/
//$NON-NLS-1$
String execute = Messages.getString("LoginProjectPage.execute");
// Image openImage = ImageProvider.getImage(ERepositoryImages.OPEN_PROJECT_ICON);
// Connection Area
title = new Label(container, SWT.NONE);
title.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
title.setText(Messages.getString("LoginProjectPage.title"));
connectionManageArea = new Composite(container, SWT.NONE);
connectionsViewer = new ComboViewer(connectionManageArea, SWT.READ_ONLY);
connectionsViewer.getControl().setFont(LoginDialogV2.fixedFont);
manageButton = new Button(connectionManageArea, SWT.NONE);
manageButton.setFont(LoginDialogV2.fixedFont);
manageButton.setBackground(backgroundColor);
//$NON-NLS-1$
manageButton.setText(Messages.getString("LoginProjectPage.manage"));
// Project Operation Area
projectOperationArea = new Composite(container, SWT.NONE);
// Existing Project Area
selectExistingProject = new Button(projectOperationArea, SWT.RADIO);
selectExistingProject.setFont(LoginDialogV2.fixedFont);
selectExistingProject.setBackground(backgroundColor);
//$NON-NLS-1$
selectExistingProject.setText(Messages.getString("LoginProjectPage.selectProject"));
projectListArea = new Composite(projectOperationArea, SWT.NONE);
projectViewer = new ListViewer(projectListArea, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
projectViewer.getControl().setFont(LoginDialogV2.fixedFont);
projectViewer.setContentProvider(ArrayContentProvider.getInstance());
projectViewer.setLabelProvider(new ProjectLabelProvider());
projectViewer.setSorter(new ViewerSorter());
// Branch Area
branchArea = new Composite(projectListArea, SWT.NONE);
branchLabel = new Label(branchArea, SWT.NONE);
branchLabel.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
branchLabel.setText(Messages.getString("LoginProjectPage.Branch"));
branchesViewer = new ComboViewer(branchArea, SWT.READ_ONLY);
branchesViewer.getControl().setFont(LoginDialogV2.fixedFont);
branchesViewer.setContentProvider(ArrayContentProvider.getInstance());
branchesViewer.setLabelProvider(new LabelProvider());
refreshProjectButton = new Button(branchArea, SWT.NONE);
refreshProjectButton.setFont(LoginDialogV2.fixedFont);
refreshProjectButton.setBackground(backgroundColor);
refreshProjectButton.setImage(ImageProvider.getImage(EImage.REFRESH_ICON));
// Create New Project
createNewProject = new Button(projectOperationArea, SWT.RADIO);
createNewProject.setFont(LoginDialogV2.fixedFont);
createNewProject.setBackground(backgroundColor);
//$NON-NLS-1$
createNewProject.setText(Messages.getString("LoginProjectPage.createNewProject"));
newProjectName = new Text(projectOperationArea, SWT.BORDER);
newProjectName.setFont(LoginDialogV2.fixedFont);
newProjectName.setBackground(backgroundColor);
executeCreateNewProject = new Button(projectOperationArea, SWT.NONE);
executeCreateNewProject.setFont(LoginDialogV2.fixedFont);
//$NON-NLS-1$
executeCreateNewProject.setText(Messages.getString("LoginProjectPage.create"));
executeCreateNewProject.setBackground(backgroundColor);
// Import Demo Project
importDemoProject = new Button(projectOperationArea, SWT.RADIO);
importDemoProject.setFont(LoginDialogV2.fixedFont);
importDemoProject.setBackground(backgroundColor);
//$NON-NLS-1$
importDemoProject.setText(Messages.getString("LoginProjectPage.importDemoProject"));
executeImportDemoProject = new Button(projectOperationArea, SWT.NONE);
executeImportDemoProject.setFont(LoginDialogV2.fixedFont);
// executeImportDemoProject.setImage(openImage);
executeImportDemoProject.setText(execute);
executeImportDemoProject.setBackground(backgroundColor);
// Import Local Project
importLocalProject = new Button(projectOperationArea, SWT.RADIO);
importLocalProject.setFont(LoginDialogV2.fixedFont);
importLocalProject.setBackground(backgroundColor);
//$NON-NLS-1$
importLocalProject.setText(Messages.getString("LoginProjectPage.importLocalProject"));
executeImportLocalProject = new Button(projectOperationArea, SWT.NONE);
executeImportLocalProject.setFont(LoginDialogV2.fixedFont);
// executeImportLocalProject.setImage(openImage);
executeImportLocalProject.setText(execute);
executeImportLocalProject.setBackground(backgroundColor);
// Create SandBox Project
createSandBoxProject = new Button(projectOperationArea, SWT.RADIO);
createSandBoxProject.setFont(LoginDialogV2.fixedFont);
createSandBoxProject.setBackground(backgroundColor);
//$NON-NLS-1$
createSandBoxProject.setText(Messages.getString("LoginProjectPage.createSandBoxProject.title"));
executeCreateSandBoxProject = new Button(projectOperationArea, SWT.NONE);
executeCreateSandBoxProject.setFont(LoginDialogV2.fixedFont);
// executeCreateSandBoxProject.setImage(openImage);
executeCreateSandBoxProject.setText(execute);
executeCreateSandBoxProject.setBackground(backgroundColor);
super.instantiateControl(container);
}
use of org.eclipse.jface.viewers.ComboViewer in project tdi-studio-se by Talend.
the class ContextParameterPage method createControl.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
GridData data;
// Name
Label nameLabel = new Label(container, SWT.NONE);
//$NON-NLS-1$
nameLabel.setText(Messages.getString("ContextParameterPage.name"));
nameText = new Text(container, SWT.BORDER);
nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Comment
Label commentLabel = new Label(container, SWT.NONE);
//$NON-NLS-1$
commentLabel.setText(Messages.getString("ContextParameterPage.comment"));
commentLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
commentText = new Text(container, SWT.BORDER | SWT.MULTI | SWT.WRAP);
data = new GridData(GridData.FILL_HORIZONTAL);
data.heightHint = 60;
commentText.setLayoutData(data);
// Type
Label typeLabel = new Label(container, SWT.NONE);
//$NON-NLS-1$
typeLabel.setText(Messages.getString("ContextParameterPage.type"));
typeViewer = new ComboViewer(container, SWT.BORDER | SWT.READ_ONLY);
typeViewer.setContentProvider(ArrayContentProvider.getInstance());
typeViewer.setLabelProvider(new LabelProvider());
typeViewer.setInput(MetadataTalendType.getCxtParameterTalendTypesLabels());
typeViewer.getControl().setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Prompt
Label promptLabel = new Label(container, SWT.NONE);
//$NON-NLS-1$
promptLabel.setText(Messages.getString("ContextParameterPage.prompt"));
promptText = new Text(container, SWT.BORDER);
promptText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// Prompt
new Label(container, SWT.NONE);
promptBtn = new Button(container, SWT.CHECK);
//$NON-NLS-1$
promptBtn.setText(Messages.getString("ContextParameterPage.shouldPrompt"));
// Default
Label defaultLabel = new Label(container, SWT.NONE);
//$NON-NLS-1$
defaultLabel.setText(Messages.getString("ContextParameterPage.defaultValue"));
defaultText = new Text(container, SWT.BORDER);
defaultText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(container);
updateContent();
addListeners();
updatePageComplete();
}
Aggregations