本文整理了Java中org.eclipse.swt.widgets.Shell.getMaximized()
方法的一些代码示例,展示了Shell.getMaximized()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getMaximized()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:getMaximized
[英]Returns true
if the receiver is currently maximized, and false otherwise.
[中]如果接收器当前最大化,则返回true
,否则返回false。
代码示例来源:origin: pentaho/pentaho-kettle
public WindowProperty( Shell shell ) {
name = shell.getText();
maximized = shell.getMaximized();
rectangle = shell.getBounds();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public boolean matches( Widget widget ) {
return ( ( Shell )widget ).getMaximized();
}
} );
代码示例来源: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 controlResized(ControlEvent e) {
if (!shell.getMaximized()) {
Point size = shell.getSize();
w = size.x;
h = size.y;
}
}
});
代码示例来源:origin: org.eclipse/org.eclipse.help.ui
public void controlResized(ControlEvent e) {
if (!shell.getMaximized()) {
Point size = shell.getSize();
w = size.x;
h = size.y;
}
}
});
代码示例来源: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: BiglySoftware/BiglyBT
private int calcState(Shell shell) {
return shell.getMinimized() ? SWT.MIN : shell.getMaximized() ? SWT.MAX : SWT.NONE;
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
Shell shell = Utils.getActiveShell();
if (shell == null || shell.isDisposed()) {
event.doit = false;
return;
}
shell.setMaximized(!shell.getMaximized());
}
});
代码示例来源:origin: org.eclipse/org.eclipse.help.ui
public void widgetDisposed(DisposeEvent e) {
// save position
store.setValue(BROWSER_X, Integer.toString(x));
store.setValue(BROWSER_Y, Integer.toString(y));
store.setValue(BROWSER_WIDTH, Integer.toString(w));
store.setValue(BROWSER_HEIGTH, Integer.toString(h));
store.setValue(BROWSER_MAXIMIZED, (new Boolean(shell
.getMaximized()).toString()));
notifyCloseListners();
}
});
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private static String getMode( final Shell shell ) {
String result = null;
if( shell.getMinimized() ) {
result = "minimized";
} else if( shell.getMaximized() || shell.getFullScreen() ) {
result = "maximized";
}
return result;
}
代码示例来源:origin: stackoverflow.com
private void bringToFront(final Shell shell) {
showDesktop(); //minimize all the application
Thread.sleep(5000); // here have to wait for some time, I am not sure why
shell.getDisplay().asyncExec(new Runnable() {
public void run() {
if(!shell.getMaximized()){
shell.setMaximized(true);
}
shell.forceActive();
}
});
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private static String getMode( Shell shell ) {
String result = null;
if( shell.getMinimized() ) {
result = "minimized";
} else if( shell.getFullScreen() ) {
result = "fullscreen";
} else if( shell.getMaximized() ) {
result = "maximized";
}
return result;
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public void widgetDisposed(DisposeEvent e) {
Shell shell = (Shell) e.widget;
if (disposeME != null) {
disposeME.getTags().remove(ShellMinimizedTag);
disposeME.getTags().remove(ShellMaximizedTag);
if (shell.getMinimized())
disposeME.getTags().add(ShellMinimizedTag);
if (shell.getMaximized())
disposeME.getTags().add(ShellMaximizedTag);
}
}
});
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public void controlResized(ControlEvent e) {
// Don't store the maximized size in the model
if (shell.getMaximized())
return;
try {
ignoreSizeChanges = true;
w.setWidth(shell.getSize().x);
w.setHeight(shell.getSize().y);
} finally {
ignoreSizeChanges = false;
}
}
代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt
public void controlMoved(ControlEvent e) {
// Don't store the maximized size in the model
if (shell.getMaximized())
return;
try {
ignoreSizeChanges = true;
w.setX(shell.getLocation().x);
w.setY(shell.getLocation().y);
} finally {
ignoreSizeChanges = false;
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt
@Override
public void controlResized(ControlEvent e) {
// Don't store the maximized size in the model
if (shell.getMaximized()) {
return;
}
try {
ignoreSizeChanges = true;
w.setWidth(shell.getSize().x);
w.setHeight(shell.getSize().y);
} finally {
ignoreSizeChanges = false;
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.renderers.swt
@Override
public void controlMoved(ControlEvent e) {
// Don't store the maximized size in the model
if (shell.getMaximized()) {
return;
}
try {
ignoreSizeChanges = true;
w.setX(shell.getLocation().x);
w.setY(shell.getLocation().y);
} finally {
ignoreSizeChanges = false;
}
}
});
代码示例来源:origin: stackoverflow.com
public static void main(String[] args)
{
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("StackOverflow");
shell.addListener(SWT.Resize, new Listener()
{
@Override
public void handleEvent(Event arg0)
{
if(shell.getMaximized())
System.out.println("Maximize");
}
});
shell.pack();
shell.open();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
Shell shell = Utils.getActiveShell();
if ( shell == null || shell.isDisposed() || item.isDisposed()) {
return;
}
if (!Constants.isOSX) {
if (shell.getMaximized()) {
Messages.setLanguageText(item, MENU_ID_WINDOW_ZOOM_RESTORE);
} else {
Messages.setLanguageText(item, MENU_ID_WINDOW_ZOOM_MAXIMIZE);
}
}
if (((shell.getStyle() & SWT.MAX) != 0)) {
item.setEnabled(!shell.getMinimized());
} else {
item.setEnabled(false);
}
}
};
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
public void readData( Display display ) {
readBounds( display );
readCursorLocation( display );
readFocusControl( display );
ActiveKeysUtil.readKeyEvents( display );
WidgetTreeVisitor visitor = new AllWidgetTreeVisitor() {
public boolean doVisit( final Widget widget ) {
IWidgetLifeCycleAdapter adapter = WidgetUtil.getLCA( widget );
adapter.readData( widget );
return true;
}
};
Shell[] shells = getShells( display );
for( int i = 0; i < shells.length; i++ ) {
Composite shell = shells[ i ];
WidgetTreeVisitor.accept( shell, visitor );
}
for( int i = 0; i < shells.length; i++ ) {
if( shells[ i ].getMaximized() || shells[ i ].getFullScreen() ) {
Object adapter = shells[ i ].getAdapter( IShellAdapter.class );
IShellAdapter shellAdapter = ( IShellAdapter )adapter;
shellAdapter.setBounds( display.getBounds() );
}
}
DNDSupport.processEvents();
}
内容来源于网络,如有侵权,请联系作者删除!