use of org.apache.pivot.wtk.Window in project pivot by apache.
the class Pivot800 method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
Window window = new Window();
window.setMaximized(true);
sheet = new FileBrowserSheet(FileBrowserSheet.Mode.SAVE_TO);
sheet.getWindowStateListeners().add(new SelectFileListener());
window.open(display);
sheet.open(window);
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class Pivot837 method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
Window window = (Window) bxmlSerializer.readObject(getClass().getResource("pivot_837.bxml"));
window.open(display);
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class Pivot951 method startup.
@Override
public void startup(Display display, Map<String, String> properties) {
window = new Window();
Border brd = new Border();
brd.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener() {
@Override
public boolean mouseClick(Component component, Button button, int x, int y, int count) {
if (count == 1) {
System.out.println("Click!");
} else {
System.out.println("Double Click!");
}
return true;
}
});
window.setContent(brd);
window.setTitle("Pivot951: Cannot click twice");
window.setMaximized(true);
window.open(display);
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class HelloJava method startup.
@Override
public void startup(Display display, Map<String, String> properties) {
this.window = new Window();
Label label = new Label();
label.setText("Hello World!");
label.getStyles().put(Style.font, new Font("Arial", Font.BOLD, 24));
label.getStyles().put(Style.color, Color.RED);
label.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.CENTER);
label.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
this.window.setContent(label);
this.window.setTitle("Hello World!");
this.window.setMaximized(true);
this.window.open(display);
}
use of org.apache.pivot.wtk.Window in project pivot by apache.
the class FileBrowserWithCharsetTest method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BoxPane windowContent = new BoxPane();
windowContent.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
final Checkbox showHiddenCheckbox = new Checkbox("Show hidden files");
windowContent.add(showHiddenCheckbox);
PushButton button = new PushButton("Open File Browser");
button.getStyles().put(Style.padding, "[2, 4, 2, 4]");
button.getButtonPressListeners().add(new ButtonPressListener() {
@Override
public void buttonPressed(Button buttonArgument) {
final Window window = Window.getActiveWindow();
final FileBrowserWithCharsetTest fileBrowserSheet = new FileBrowserWithCharsetTest(FileBrowserSheet.Mode.OPEN);
fileBrowserSheet.getStyles().put(Style.showHiddenFiles, showHiddenCheckbox.isSelected());
fileBrowserSheet.open(window, new SheetCloseListener() {
@Override
public void sheetClosed(Sheet sheet) {
if (sheet.getResult()) {
Sequence<File> selectedFiles = fileBrowserSheet.getSelectedFiles();
ListView listView = new ListView();
listView.setListData(new ArrayList<>(selectedFiles));
listView.setSelectMode(ListView.SelectMode.NONE);
listView.getStyles().put(Style.backgroundColor, null);
Alert.alert(MessageType.INFO, "You selected (charset " + fileBrowserSheet.getCharsetName() + "):", listView, window);
} else {
Alert.alert(MessageType.INFO, "You didn't select anything.", window);
}
}
});
}
});
windowContent.add(button);
frame = new Frame(windowContent);
frame.setMaximized(true);
frame.open(display);
}
Aggregations