use of org.eclipse.jface.window.DefaultToolTip in project azure-tools-for-java by Microsoft.
the class WebAppDeployDialog method createSlotGroup.
private void createSlotGroup(Composite container) {
ScrolledComposite scrolledComposite = new ScrolledComposite(container, SWT.V_SCROLL);
scrolledComposite.setLayout(new FillLayout(SWT.HORIZONTAL));
GridData gdGrpSlot = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
gdGrpSlot.heightHint = 140;
scrolledComposite.setLayoutData(gdGrpSlot);
Group grpSlot = new Group(scrolledComposite, SWT.NONE);
grpSlot.setLayout(new FillLayout(SWT.HORIZONTAL));
grpSlot.setLayoutData(gdGrpSlot);
grpSlot.setText("Deployment Slot");
Composite compositeSlot = new Composite(grpSlot, SWT.NONE);
compositeSlot.setLayout(new GridLayout(2, false));
RowLayout rowLayout = new RowLayout();
rowLayout.marginLeft = 0;
rowLayout.marginTop = 0;
rowLayout.marginRight = 0;
rowLayout.marginBottom = 0;
Composite compositeSlotCb = new Composite(compositeSlot, SWT.LEFT);
compositeSlotCb.setLayout(rowLayout);
btnDeployToSlot = new Button(compositeSlotCb, SWT.CHECK);
btnDeployToSlot.setSelection(false);
btnDeployToSlot.setText("Deploy to Slot");
btnDeployToSlot.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
radioSlotLogic();
fillSlot();
}
});
DefaultToolTip iconTooltip = new DefaultToolTip(btnDeployToSlot, SWT.NONE, false);
iconTooltip.setText(DEPLOYMENT_SLOT_HOVER);
btnDeployToSlot.addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
iconTooltip.show(new Point(btnDeployToSlot.getSize().x, 0));
}
@Override
public void focusLost(FocusEvent e) {
iconTooltip.hide();
}
});
new Label(compositeSlot, SWT.NONE);
btnSlotUseExisting = new Button(compositeSlot, SWT.RADIO);
btnSlotUseExisting.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
radioSlotLogic();
}
});
btnSlotUseExisting.setSelection(true);
btnSlotUseExisting.setText("Use existing");
comboSlot = new Combo(compositeSlot, SWT.READ_ONLY);
AccessibilityUtils.addAccessibilityNameForUIComponent(comboSlot, "Existing deployment slot");
comboSlot.setEnabled(false);
comboSlot.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
comboSlot.setBounds(0, 0, 26, 22);
comboSlot.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
cleanError();
}
});
decComboSlot = decorateContorolAndRegister(comboSlot);
btnSlotCreateNew = new Button(compositeSlot, SWT.RADIO);
btnSlotCreateNew.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
radioSlotLogic();
}
});
btnSlotCreateNew.setText("Create new");
textSlotName = new Text(compositeSlot, SWT.BORDER);
textSlotName.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
cleanError();
}
});
AccessibilityUtils.addAccessibilityNameForUIComponent(textSlotName, "New depoyment slot");
textSlotName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
textSlotName.setBounds(0, 0, 64, 19);
textSlotName.setMessage("Slot Name");
textSlotName.setText("slot-" + date);
textSlotName.setEnabled(false);
decTextSlotName = decorateContorolAndRegister(textSlotName);
lblSlotConf = new Label(compositeSlot, SWT.NONE);
lblSlotConf.setEnabled(false);
GridData gdLblSlotConf = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gdLblSlotConf.horizontalIndent = 20;
lblSlotConf.setLayoutData(gdLblSlotConf);
lblSlotConf.setText("Clone settings from");
comboSlotConf = new Combo(compositeSlot, SWT.READ_ONLY);
comboSlotConf.setEnabled(false);
comboSlotConf.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
comboSlotConf.setBounds(0, 0, 26, 22);
comboSlotConf.addFocusListener(new FocusAdapter() {
@Override
public void focusGained(FocusEvent e) {
cleanError();
}
});
AccessibilityUtils.addAccessibilityNameForUIComponent(comboSlotConf, "Deployment slot configuration source");
decComboSlotConf = decorateContorolAndRegister(comboSlotConf);
scrolledComposite.setContent(grpSlot);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setMinSize(grpSlot.computeSize(SWT.DEFAULT, SWT.DEFAULT));
fillSlot();
radioSlotLogic();
}
use of org.eclipse.jface.window.DefaultToolTip in project jbosstools-openshift by jbosstools.
the class WebHooksComponent method notifyCopied.
private void notifyCopied(final Text uriText) {
DefaultToolTip copiedNotification = new DefaultToolTip(uriText, ToolTip.NO_RECREATE, true);
copiedNotification.setText("Webhook copied to clipboard");
copiedNotification.setHideDelay(COPIED_NOTIFICATION_SHOW_DURATION);
copiedNotification.show(uriText.getLocation());
copiedNotification.deactivate();
}
Aggregations