use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.
the class WebCrawlImportDialog method buildSameURLGroup.
public void buildSameURLGroup() {
sameURLGroup = new Group(comp, SWT.SHADOW_NONE);
sameURLGroup.setText(SAME_URL_GROUP);
sameURLGroup.setLayout(new FormLayout());
pruneCrawlOnSame = new Button(sameURLGroup, SWT.RADIO);
pruneCrawlOnSame.setText(SAME_URL_PRUNE_LABEL);
pruneCrawlOnSame.setSelection(true);
pruneCrawlOnSame.setEnabled(false);
replacePageOnSame = new Button(sameURLGroup, SWT.RADIO);
replacePageOnSame.setText(SAME_URL_REPLACE_LABEL);
replacePageOnSame.setEnabled(false);
}
use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.
the class WebCrawlImportDialog method buildThirdGroup.
public void buildThirdGroup() {
typeHTMLGroup3 = new Group(useSelectionGroup, SWT.SHADOW_NONE);
typeHTMLGroup3.setText("Starting URL #3");
typeHTMLGroup3.setLayout(new FormLayout());
urlText3 = new TextWithEnableFix(typeHTMLGroup3, SWT.BORDER | SWT.SINGLE);
urlText3.setText("http://");
urlText3.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
e.detail = SWT.TRAVERSE_NONE;
questionMarkButtonDomain2.forceFocus();
}
}
});
plusButton3 = makeToolBarButton(typeHTMLGroup3, addGroupListener, questionImages.PLUS_IMAGE);
minusButton3 = makeToolBarButton(typeHTMLGroup3, minusGroupListener3, questionImages.MINUS_IMAGE);
maximumDepthToCrawlLabel3 = new Label(typeHTMLGroup3, SWT.NONE);
maximumDepthToCrawlLabel3.setText("Maximum Depth To Crawl: ");
questionMarkButtonDepth3 = makeToolBarButton(typeHTMLGroup3, depthListener, questionImages.QUESTION_SHADOW);
maxDepthCombo3 = new ComboWithEnableFix(typeHTMLGroup3, SWT.DROP_DOWN | SWT.READ_ONLY);
maxDepthCombo3.add("Unlimited");
for (int i = 0; i < 100; i++) {
maxDepthCombo3.add("" + i);
}
maxDepthCombo3.select(2);
maxDepthCombo3.setVisibleItemCount(21);
useHTML7 = new Button(typeHTMLGroup3, SWT.RADIO);
useHTML7.addSelectionListener(domainListener);
useHTML7.setSelection(true);
useHTML8 = new Button(typeHTMLGroup3, SWT.RADIO);
useHTML8.addSelectionListener(domainListener);
useHTML9 = new Button(typeHTMLGroup3, SWT.RADIO);
useHTML9.addSelectionListener(domainListener);
urlPath7 = new Label(typeHTMLGroup3, SWT.NONE);
urlPath7.setText("Unrestricted");
urlPath8 = new Label(typeHTMLGroup3, SWT.NONE);
urlPath8.setText("http://host_name/");
urlPath9 = new Label(typeHTMLGroup3, SWT.NONE);
urlPath9.setText("http://host_name/path");
urlPath9b = new Label(typeHTMLGroup3, SWT.NONE);
urlPath9b.setText("path");
urlPath9b.setFont(URL_PATH_FONT);
urlPath9b.setVisible(false);
maxDepthCombo3.addSelectionListener(comboListener);
restrictDomainLabel3 = new Label(typeHTMLGroup3, SWT.NONE);
restrictDomainLabel3.setText("Restrict Domain: ");
questionMarkButtonDomain3 = makeToolBarButton(typeHTMLGroup3, domainHelpListener, questionImages.QUESTION_SHADOW);
urlText3.addFocusListener(new TextFocusListener(urlText3, urlPath8, urlPath9, useHTML7, useHTML8, useHTML9, 3));
}
use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.
the class Keypad method makeNumbers.
/**
* Creates and lays out the buttons for the keypad's number pad.
*
* @author Paul Rubritz (ptr@andrew.cmu.edu)
*/
protected void makeNumbers() {
GridLayout grid = new GridLayout();
grid.numColumns = 3;
GridData gridKeysOption = new GridData();
gridKeysOption.horizontalIndent = (keypadType == FULL_KEYPAD) ? 60 : 0;
gridKeysOption.verticalAlignment = SWT.TOP;
Composite numbers = new Composite(dialog, SWT.NONE);
numbers.setLayoutData(gridKeysOption);
numbers.setLayout(grid);
Button keypadButton;
for (int i = 0; i < numberKeys.length; i++) {
gridKeysOption = new GridData();
if (i < numberKeys.length - 1) {
gridKeysOption.widthHint = 50;
} else if (keypadType == NUMPAD_ONLY) {
gridKeysOption.widthHint = 160;
gridKeysOption.horizontalSpan = 3;
} else {
break;
}
gridKeysOption.heightHint = 50;
keypadButton = makeButton(numbers, numberKeys[i], gridKeysOption);
// (see IntegerEntry)
if ((keypadType == NUMPAD_ONLY) && numberKeys[i].equals("-")) {
keypadButton.setBackground(getDisabledColor());
keypadButton.setEnabled(false);
}
}
}
use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.
the class Keypad method makeButton.
protected Button makeButton(Composite parent, String buttonLabel, GridData gridKeysOption, SelectionListener listener) {
Button keypadButton = new Button(parent, SWT.PUSH);
keypadButton.setText(buttonLabel);
keypadButton.setFont(FontUtils.DEFAULT_FONT);
keypadButton.setLayoutData(gridKeysOption);
keypadButton.addSelectionListener(listener);
return keypadButton;
}
use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.
the class StoppableProgressBar method addBelowBar.
@Override
protected void addBelowBar() {
super.addBelowBar();
// box, tying it to the given pausable "process" object.
if (stopListener != null) {
stopButton = new Button(shell, SWT.PUSH);
stopButton.setText(STOP_LABEL);
stopButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
stopListener.stop();
stopButton.setEnabled(false);
}
});
FormData data = new FormData();
// Replace positioning for cancelButton if present
if (cancelButton != null) {
data.left = new FormAttachment(50, 3);
data.top = new FormAttachment(bar, 5, SWT.BOTTOM);
cancelButton.setLayoutData(data);
data = new FormData();
data.right = new FormAttachment(50, -3);
data.top = new FormAttachment(bar, 5, SWT.BOTTOM);
} else {
data.left = new FormAttachment(bar, 0, SWT.CENTER);
data.top = new FormAttachment(bar, 5, SWT.BOTTOM);
}
stopButton.setLayoutData(data);
}
}
Aggregations