本文整理了Java中org.eclipse.swt.widgets.Shell.getLocation()
方法的一些代码示例,展示了Shell.getLocation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getLocation()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:getLocation
暂无
代码示例来源:origin: org.xworker/xworker_swt
@Override
public void widgetDisposed(DisposeEvent event) {
location = ((Shell) event.widget).getLocation();
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
public final void forceSaveLocation() {
if (!splash.isDisposed()) {
this.storeLastLocation(splash.getLocation());
}
}
代码示例来源:origin: org.eclipse/org.eclipse.help.ui
public void controlMoved(ControlEvent e) {
if (!shell.getMaximized()) {
Point location = shell.getLocation();
x = location.x;
y = location.y;
}
}
public void controlResized(ControlEvent e) {
代码示例来源:origin: org.eclipse/org.eclipse.help.ui
public void controlMoved(ControlEvent e) {
if (!shell.getMaximized()) {
Point location = shell.getLocation();
x = location.x;
y = location.y;
}
}
public void controlResized(ControlEvent e) {
代码示例来源:origin: stackoverflow.com
private static final void toggleAlwaysOnTop(Shell shell, boolean isOnTop){
long handle = shell.handle;
Point location = shell.getLocation();
Point dimension = shell.getSize();
OS.SetWindowPos(handle, isOnTop ? OS.HWND_TOPMOST : OS.HWND_NOTOPMOST,location.x, location.y, dimension.x, dimension.y, 0);
}
代码示例来源:origin: BiglySoftware/BiglyBT
public static Point getLocationRelativeToShell(Control control) {
Point controlLocation = control.toDisplay(0, 0);
Point shellLocation = control.getShell().getLocation();
return new Point(controlLocation.x - shellLocation.x, controlLocation.y - shellLocation.y);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
@Override
public void expansionStateChanged(ExpansionEvent e) {
launchData.setShowRecentWorkspaces(((ExpandableComposite) e.getSource()).isExpanded());
Point size = getInitialSize();
Shell shell = getShell();
shell.setBounds(getConstrainedShellBounds(
new Rectangle(shell.getLocation().x, shell.getLocation().y, size.x, size.y)));
}
});
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private void updatePopupLocation(boolean force) {
if (! force && fSnapPosition == SNAP_POSITION_LOWER_RIGHT)
return;
packPopup();
Point loc= computePopupLocation(fSnapPosition);
if (loc != null && ! loc.equals(fPopup.getLocation())) {
fPopup.setLocation(loc);
// XXX workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=170774
// fPopup.moveBelow(fEditor.getSite().getShell().getShells()[0]);
}
}
代码示例来源:origin: org.eclipse.xtext/ui
protected void updatePopupLocation() {
packPopup();
Point loc = computePopupLocation();
if (loc != null && !loc.equals(popup.getLocation())) {
popup.setLocation(loc);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private void updatePopupLocation(boolean force) {
if (! force && fSnapPosition == SNAP_POSITION_LOWER_RIGHT)
return;
packPopup();
Point loc= computePopupLocation(fSnapPosition);
if (loc != null && ! loc.equals(fPopup.getLocation())) {
fPopup.setLocation(loc);
// XXX workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=170774
// fPopup.moveBelow(fEditor.getSite().getShell().getShells()[0]);
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
protected Point getStackedLocation(Shell shell, Shell parent) {
Point p= parent.getLocation();
Point size= parent.getSize();
p.x += size.x / 4;
p.y += size.y;
p= parent.toDisplay(p);
Rectangle shellBounds= shell.getBounds();
Rectangle displayBounds= shell.getDisplay().getClientArea();
shiftHorizontalLocation(p, shellBounds, displayBounds);
shiftVerticalLocation(p, shellBounds, displayBounds);
return p;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
protected Point getStackedLocation(Shell shell, Shell parent) {
Point p= parent.getLocation();
Point size= parent.getSize();
p.x += size.x / 4;
p.y += size.y;
p= parent.toDisplay(p);
Rectangle shellBounds= shell.getBounds();
Rectangle displayBounds= shell.getDisplay().getClientArea();
shiftHorizontalLocation(p, shellBounds, displayBounds);
shiftVerticalLocation(p, shellBounds, displayBounds);
return p;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
protected Point getStackedLocation(Shell shell, Shell parent) {
Point p= parent.getLocation();
Point size= parent.getSize();
p.x += size.x / 4;
p.y += size.y;
p= parent.toDisplay(p);
Point shellSize= shell.getSize();
Monitor monitor= getClosestMonitor(parent.getDisplay(), new Rectangle(p.x, p.y, 0, 0));
Rectangle displayBounds= monitor.getClientArea();
constrainLocation(p, shellSize, displayBounds);
return p;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text
protected Point getStackedLocation(Shell shell, Shell parent) {
Point p= parent.getLocation();
Point size= parent.getSize();
p.x += size.x / 4;
p.y += size.y;
p= parent.toDisplay(p);
Point shellSize= shell.getSize();
Monitor monitor= getClosestMonitor(parent.getDisplay(), new Rectangle(p.x, p.y, 0, 0));
Rectangle displayBounds= monitor.getClientArea();
constrainLocation(p, shellSize, displayBounds);
return p;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
/**
* Stores it current configuration in the dialog store.
*/
private void writeSettings() {
Point location= getShell().getLocation();
fSettings.put("x", location.x); //$NON-NLS-1$
fSettings.put("y", location.y); //$NON-NLS-1$
Point size= getShell().getSize();
fSettings.put("width", size.x); //$NON-NLS-1$
fSettings.put("height", size.y); //$NON-NLS-1$
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
/**
* Stores it current configuration in the dialog store.
*/
private void writeSettings() {
IDialogSettings s= getDialogSettings();
Point location= getShell().getLocation();
s.put("x", location.x); //$NON-NLS-1$
s.put("y", location.y); //$NON-NLS-1$
Point size= getShell().getSize();
s.put("width", size.x); //$NON-NLS-1$
s.put("height", size.y); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse.ui.views/log
private void writeConfiguration() {
IDialogSettings s = getDialogSettings();
Point location = getShell().getLocation();
s.put("x", location.x); //$NON-NLS-1$
s.put("y", location.y); //$NON-NLS-1$
Point size = getShell().getSize();
s.put("width", size.x); //$NON-NLS-1$
s.put("height", size.y); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
/**
* Stores it current configuration in the dialog store.
*/
private void writeSettings() {
IDialogSettings s= getDialogSettings();
Point location= getShell().getLocation();
s.put("x", location.x); //$NON-NLS-1$
s.put("y", location.y); //$NON-NLS-1$
Point size= getShell().getSize();
s.put("width", size.x); //$NON-NLS-1$
s.put("height", size.y); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse/org.eclipse.pde.runtime
private void writeConfiguration() {
IDialogSettings s = getDialogSettings();
Point location = getShell().getLocation();
s.put("x", location.x); //$NON-NLS-1$
s.put("y", location.y); //$NON-NLS-1$
Point size = getShell().getSize();
s.put("width", size.x); //$NON-NLS-1$
s.put("height", size.y); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
/**
* Stores it current configuration in the dialog store.
*/
private void writeSettings() {
IDialogSettings s= getDialogSettings();
Point location= getShell().getLocation();
s.put("x", location.x); //$NON-NLS-1$
s.put("y", location.y); //$NON-NLS-1$
Point size= getShell().getSize();
s.put("width", size.x); //$NON-NLS-1$
s.put("height", size.y); //$NON-NLS-1$
}
内容来源于网络,如有侵权,请联系作者删除!