本文整理汇总了Java中org.eclipse.swt.SWT.SHELL_TRIM属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.SHELL_TRIM属性的具体用法?Java SWT.SHELL_TRIM怎么用?Java SWT.SHELL_TRIM使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.SHELL_TRIM属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
/**
* Setup the Disk window and display (open) it.
*/
public void open() {
shell = new Shell(parentShell, SWT.SHELL_TRIM);
shell.setLayout(new FillLayout());
shell.setImage(imageManager.get(ImageManager.ICON_DISK));
setStandardWindowTitle();
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent event) {
dispose(event);
}
});
CTabFolder tabFolder = new CTabFolder(shell, SWT.BOTTOM);
new DiskExplorerTab(tabFolder, disks, imageManager, this);
diskMapTabs = new DiskMapTab[disks.length];
for (int i=0; i<disks.length; i++) {
if (disks[i].supportsDiskMap()) {
diskMapTabs[i] = new DiskMapTab(tabFolder, disks[i]);
}
}
diskInfoTab = new DiskInfoTab(tabFolder, disks);
tabFolder.setSelection(tabFolder.getItems()[0]);
shell.open();
}
示例2: main
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display, SWT.SHELL_TRIM);
shell.setLayout(new FillLayout(SWT.VERTICAL));
final Label label = new Label(shell, SWT.BORDER);
final Text text = new Text(shell, SWT.BORDER);
text.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
Image pathIcon = getPathIcon(text.getText(), false, false);
label.setImage(pathIcon);
}
});
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
}
示例3: ImageCanvas
/**
* Constructor for ImageCanvas.
*/
public ImageCanvas(Composite parent, int style, Image image, Object layoutData) {
super(parent, style | SWT.SHELL_TRIM | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE);
this.image = image;
setLayoutData(layoutData);
setSize(image.getImageData().width, image.getImageData().height);
addPaintListener(this);
}
示例4: main
public static void main(String[] args) {
Display display = Display.getDefault();
Shell shell = new Shell(display, SWT.SHELL_TRIM);
shell.open();
MessageBoxShell messageBoxShell = new MessageBoxShell(
"Title",
"Test\n"
+ "THis is a very long line that tests whether the box gets really wide which is something we don't want.\n"
+ "A <A HREF=\"Link\">link</A> for <A HREF=\"http://moo.com\">you</a>",
new String[] {
"Okay",
"Cancyyyyyy",
"Maybe"
}, 1);
messageBoxShell.setRemember("test2", false,
MessageText.getString("MessageBoxWindow.nomoreprompting"));
messageBoxShell.setAutoCloseInMS(15000);
messageBoxShell.setParent(shell);
messageBoxShell.setHtml("<b>Moo</b> goes the cow<p><hr>");
messageBoxShell.open(new UserPrompterResultListener() {
@Override
public void prompterClosed(int returnVal) {
System.out.println(returnVal);
}
});
while (!shell.isDisposed()) {
if (!display.isDisposed() && !display.readAndDispatch()) {
display.sleep();
}
}
}
示例5: ConfigFormEx
ConfigFormEx(Display parentDisplay, Shell parent) {
utils.initializeLogger();
logger.info("Initialized logger.");
Map<String, String> browserOptions = new HashMap<>();
for (String browser : new ArrayList<String>(Arrays.asList(new String[] {
"Chrome", "Firefox", "Internet Explorer", "Edge", "Safari" }))) {
browserOptions.put(browser, "unused");
}
configOptions.put("Browser", browserOptions);
// offer templates embedded in the application jar and
// make rest up to customer
configData.put("Template", "Core Selenium Java (embedded)");
configOptions.put("Template", new HashMap<String, String>());
templates = configOptions.get("Template");
// Scan the template directory and build the hash of template name / path
// options.
TemplateCache templateCache = TemplateCache.getInstance();
templateCache.fillEmbeddedTemplateCache();
templates.putAll(TemplateCache.getCache());
configOptions.replace("Template", templates);
display = (parentDisplay != null) ? parentDisplay : new Display();
// shell = new Shell(display);
shell = new Shell(display, SWT.CENTER | SWT.SHELL_TRIM/* | ~SWT.RESIZE */);
if (parent != null) {
parentShell = parent;
}
// http://stackoverflow.com/questions/585534/what-is-the-best-way-to-find-the-users-home-directory-in-java
String dirPath = null;
dirPath = osName.startsWith("windows") ? OSUtils.getDesktopPath()
: System.getProperty("user.home");
utils.readData(
parent != null ? parentShell.getData("CurrentConfig").toString()
: "{ \"Browser\": \"Chrome\", "
+ "\"Template\": \"Core Selenium Java (embedded)\", "
+ String.format("\"Template Directory\": \"%s\", ",
dirPath.replace("/", "\\").replace("\\", "\\\\"))
+ "\"Template Path\": \"\"}",
Optional.of(configData));
if (configData.containsKey("Template Directory")) {
dirPath = configData.get("Template Directory");
if (dirPath != "") {
templates = configOptions.get("Template");
// Scan the template directory and build the options hash with template
// name / absolute path
templateCache.fillTemplateDirectoryCache(new File(dirPath),
"user defined", templates);
configOptions.replace("Template", templates);
}
}
}