use of org.eclipse.swt.widgets.Widget in project tdi-studio-se by Talend.
the class GenerateDocAsHTMLWizardPage method handleEvent.
@Override
public void handleEvent(Event e) {
super.handleEvent(e);
Widget source = e.widget;
if (source instanceof Combo) {
String destination = ((Combo) source).getText();
if (getDialogSettings() != null) {
IDialogSettings section = getDialogSettings().getSection(DESTINATION_FILE);
if (section == null) {
section = getDialogSettings().addNewSection(DESTINATION_FILE);
}
section.put(DESTINATION_FILE, destination);
}
}
}
use of org.eclipse.swt.widgets.Widget in project tdi-studio-se by Talend.
the class JavaJobScriptsExportWSWizardPage method handleEvent.
@Override
public void handleEvent(Event e) {
super.handleEvent(e);
Widget source = e.widget;
if (source instanceof Combo) {
String destination = ((Combo) source).getText();
if (getDialogSettings() != null) {
IDialogSettings section = getDialogSettings().getSection(DESTINATION_FILE);
if (section == null) {
section = getDialogSettings().addNewSection(DESTINATION_FILE);
}
section.put(DESTINATION_FILE, destination);
}
if (destination != null) {
if (!destination.endsWith(getOutputSuffix())) {
destination += getOutputSuffix();
}
}
}
}
use of org.eclipse.swt.widgets.Widget in project tesb-studio-se by Talend.
the class JavaCamelJobScriptsExportWSWizardPage method createUnzipOptionGroup.
@Override
protected void createUnzipOptionGroup(Composite parent) {
// options group
Group optionsGroup = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
optionsGroup.setLayout(layout);
optionsGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
//$NON-NLS-1$
optionsGroup.setText(Messages.getString("JavaJobScriptsExportWSWizardPage.BuildType"));
optionsGroup.setLayout(new GridLayout(2, false));
Label label = new Label(optionsGroup, SWT.NONE);
//$NON-NLS-1$
label.setText(Messages.getString("JavaJobScriptsExportWSWizardPage.BuildLabel"));
exportTypeCombo = new Combo(optionsGroup, SWT.PUSH);
// TESB-5328
exportTypeCombo.add(EXPORTTYPE_KAR);
if (PluginChecker.isTIS()) {
exportTypeCombo.add(EXPORTTYPE_SPRING_BOOT);
}
// exportTypeCombo.setEnabled(false); // only can export kar file
exportTypeCombo.setText(EXPORTTYPE_KAR);
exportTypeCombo.addSelectionListener(new SelectionAdapter() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
@Override
public void widgetSelected(SelectionEvent e) {
Widget source = e.widget;
if (source instanceof Combo) {
String destination = ((Combo) source).getText();
boolean isMS = destination.equals(EXPORTTYPE_SPRING_BOOT);
if (isMS) {
contextButton.setEnabled(true);
exportAsZipButton.setEnabled(true);
} else {
contextButton.setEnabled(false);
exportAsZipButton.setEnabled(false);
}
String destinationValue = getDestinationValue();
if (isMS) {
if (exportAsZip || isAddMavenScript()) {
destinationValue = destinationValue.substring(0, destinationValue.lastIndexOf(".")) + FileConstants.ZIP_FILE_SUFFIX;
} else {
destinationValue = destinationValue.substring(0, destinationValue.lastIndexOf(".")) + FileConstants.JAR_FILE_SUFFIX;
}
} else {
destinationValue = destinationValue.substring(0, destinationValue.lastIndexOf(".")) + getOutputSuffix();
}
setDestinationValue(destinationValue);
}
}
});
}
use of org.eclipse.swt.widgets.Widget in project bndtools by bndtools.
the class BundleTree method createButtons.
private void createButtons(Composite parent) {
GridLayout gridLayout = new GridLayout(3, false);
gridLayout.marginWidth = 0;
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(gridLayout);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.grabExcessHorizontalSpace = true;
composite.setLayoutData(gridData);
showAll = new Button(composite, SWT.CHECK);
showAll.setText(Messages.showAllPackages);
showAll.setFont(getFont());
showAll.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
Widget widget = event.widget;
if (widget == showAll) {
bundleTreeViewerProvider.setShowAll(!bundleTreeViewerProvider.isShowAll());
infoTreeViewerProvider.setShowAll(!infoTreeViewerProvider.isShowAll());
if (bundleTreeViewer.getInput() != null || infoViewer.getInput() != null) {
bundleTreeViewer.setSelection(null, false);
infoViewer.setSelection(null, false);
boolean showInfoView = showInfoView(bundleTreeViewer.getInput());
if (showInfoView) {
sashForm.setMaximizedControl(null);
} else {
sashForm.setMaximizedControl(bundleTreeViewerComposite);
}
bundleTreeViewer.refresh();
infoViewer.refresh();
sashForm.redraw();
}
}
}
});
gridData = new GridData(SWT.END, SWT.CENTER, true, true);
Label label = new Label(composite, SWT.NONE);
label.setText(Messages.releaseOption);
label.setLayoutData(gridData);
options = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
options.setItems(new String[] { Messages.updateVersionsAndRelease, Messages.updateVersions, Messages.release });
options.add(Messages.comboSelectText, 0);
options.select(0);
}
use of org.eclipse.swt.widgets.Widget in project translationstudio8 by heartsome.
the class MenuItemProviders method getNatEventData.
/**
* Walk up the MenuItems (in case they are nested) and find the parent {@link Menu}
*
* @param selectionEvent
* on the {@link MenuItem}
* @return data associated with the parent {@link Menu}
*/
public static NatEventData getNatEventData(SelectionEvent selectionEvent) {
Widget widget = selectionEvent.widget;
if (widget == null || !(widget instanceof MenuItem)) {
return null;
}
MenuItem menuItem = (MenuItem) widget;
Menu parentMenu = menuItem.getParent();
Object data = null;
while (parentMenu != null) {
if (parentMenu.getData() == null) {
parentMenu = parentMenu.getParentMenu();
} else {
data = parentMenu.getData();
break;
}
}
return data != null ? (NatEventData) data : null;
}
Aggregations