📄 testmainwindow4.java
字号:
//
// This file was generated by the ui2swt tool (http://ui2swt.sourceforge.net/)
//
// Date:
// Sun Jun 17 17:26:40 EST 2007
//
// Source:
// file:/C:/Documents and Settings/James and Louisa/My Documents/Development/workspace/ui2swt/src/test/ui/TestMainWindow4.ui
//
package ui2swt.test;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.CoolBar;
import org.eclipse.swt.widgets.CoolItem;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
public class TestMainWindow4
{
public Runnable actionOpen;
public Runnable actionOne;
public Runnable actionAll;
public Runnable actionClose;
public Runnable actionIcon;
public Runnable actionSubView1;
public Menu menubar;
public Menu menuFile;
public Menu menuView;
public Menu menuView_SubMenu;
public ToolBar toolBar;
public ToolBar toolBar_2;
public ToolBar toolBar_3;
public Composite centralwidget;
public Label label;
public Browser textBrowser;
public TestMainWindow4( final Shell iParent )
{
iParent.setLayout(new FillLayout(SWT.VERTICAL));
iParent.setText("Test MainWindow 4");
iParent.setSize(354,369);
this.menubar = new Menu(iParent,SWT.BAR);
iParent.setMenuBar(this.menubar);
this.menuFile = new Menu(iParent,SWT.DROP_DOWN);
MenuItem l_menuItem;
l_menuItem = new MenuItem(this.menubar,SWT.CASCADE);
l_menuItem.setText("File");
l_menuItem.setMenu(this.menuFile);
MenuItem l_menuItem1;
l_menuItem1 = new MenuItem(this.menuFile,SWT.PUSH);
l_menuItem1.setText("Open");
l_menuItem1.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionOpen != null )
{
TestMainWindow4.this.actionOpen.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
new MenuItem(this.menuFile,SWT.SEPARATOR);
MenuItem l_menuItem2;
l_menuItem2 = new MenuItem(this.menuFile,SWT.PUSH);
l_menuItem2.setText("Close");
l_menuItem2.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionClose != null )
{
TestMainWindow4.this.actionClose.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
this.menuView = new Menu(iParent,SWT.DROP_DOWN);
l_menuItem = new MenuItem(this.menubar,SWT.CASCADE);
l_menuItem.setText("View");
l_menuItem.setMenu(this.menuView);
MenuItem l_menuItem3;
l_menuItem3 = new MenuItem(this.menuView,SWT.PUSH);
l_menuItem3.setText("View One");
l_menuItem3.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionOne != null )
{
TestMainWindow4.this.actionOne.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
new MenuItem(this.menuView,SWT.SEPARATOR);
this.menuView_SubMenu = new Menu(iParent,SWT.DROP_DOWN);
l_menuItem = new MenuItem(this.menuView,SWT.CASCADE);
l_menuItem.setText("View SubMenu");
l_menuItem.setMenu(this.menuView_SubMenu);
MenuItem l_menuItem4;
l_menuItem4 = new MenuItem(this.menuView_SubMenu,SWT.PUSH);
l_menuItem4.setText("SubView1");
l_menuItem4.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionSubView1 != null )
{
TestMainWindow4.this.actionSubView1.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
MenuItem l_menuItem5;
l_menuItem5 = new MenuItem(this.menuView,SWT.PUSH);
l_menuItem5.setText("View All");
l_menuItem5.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionAll != null )
{
TestMainWindow4.this.actionAll.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
CoolBar l_coolBar;
l_coolBar = new CoolBar(iParent,SWT.NONE);
l_coolBar.addListener(SWT.Resize, new Listener()
{
public void handleEvent(Event event)
{
iParent.layout();
}
});
this.toolBar = new ToolBar(l_coolBar,SWT.FLAT);
ToolItem l_toolItem1;
l_toolItem1 = new ToolItem(this.toolBar,SWT.PUSH);
l_toolItem1.setText("Open");
l_toolItem1.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionOpen != null )
{
TestMainWindow4.this.actionOpen.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
new ToolItem(this.toolBar,SWT.SEPARATOR);
ToolItem l_toolItem2;
l_toolItem2 = new ToolItem(this.toolBar,SWT.PUSH);
l_toolItem2.setText("Close");
l_toolItem2.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionClose != null )
{
TestMainWindow4.this.actionClose.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
this.toolBar.pack();
CoolItem l_coolItem;
Point l_coolItemSize;
Point l_coolItemPreferredSize;
l_coolItemSize = this.toolBar.getSize();
l_coolItem = new CoolItem(l_coolBar,SWT.NONE);
l_coolItem.setControl(this.toolBar);
l_coolItemPreferredSize = l_coolItem.computeSize(l_coolItemSize.x,l_coolItemSize.y);
l_coolItem.setPreferredSize(l_coolItemPreferredSize);
this.toolBar_2 = new ToolBar(l_coolBar,SWT.FLAT);
ToolItem l_toolItem3;
l_toolItem3 = new ToolItem(this.toolBar_2,SWT.PUSH);
l_toolItem3.setText("View One");
l_toolItem3.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionOne != null )
{
TestMainWindow4.this.actionOne.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
new ToolItem(this.toolBar_2,SWT.SEPARATOR);
ToolItem l_toolItem4;
l_toolItem4 = new ToolItem(this.toolBar_2,SWT.PUSH);
l_toolItem4.setText("View All");
l_toolItem4.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionAll != null )
{
TestMainWindow4.this.actionAll.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
this.toolBar_2.pack();
l_coolItemSize = this.toolBar_2.getSize();
l_coolItem = new CoolItem(l_coolBar,SWT.NONE);
l_coolItem.setControl(this.toolBar_2);
l_coolItemPreferredSize = l_coolItem.computeSize(l_coolItemSize.x,l_coolItemSize.y);
l_coolItem.setPreferredSize(l_coolItemPreferredSize);
this.toolBar_3 = new ToolBar(l_coolBar,SWT.FLAT);
ToolItem l_toolItem5;
l_toolItem5 = new ToolItem(this.toolBar_3,SWT.PUSH);
l_toolItem5.setImage(new Image(l_toolItem5.getDisplay(),"TestImage1.png"));
l_toolItem5.addSelectionListener(
new SelectionListener()
{
public void widgetSelected( SelectionEvent iEvent )
{
if ( TestMainWindow4.this.actionIcon != null )
{
TestMainWindow4.this.actionIcon.run();
}
}
public void widgetDefaultSelected( SelectionEvent iEvent )
{
this.widgetSelected(iEvent);
}
});
this.toolBar_3.pack();
l_coolItemSize = this.toolBar_3.getSize();
l_coolItem = new CoolItem(l_coolBar,SWT.NONE);
l_coolItem.setControl(this.toolBar_3);
l_coolItemPreferredSize = l_coolItem.computeSize(l_coolItemSize.x,l_coolItemSize.y);
l_coolItem.setPreferredSize(l_coolItemPreferredSize);
this.centralwidget = new Composite(iParent,SWT.NONE);
GridLayout l_gridLayout;
l_gridLayout = new GridLayout();
this.centralwidget.setLayout(l_gridLayout);
l_gridLayout.numColumns = 1;
l_gridLayout.marginLeft = 9;
l_gridLayout.marginTop = 9;
l_gridLayout.marginRight = 9;
l_gridLayout.marginBottom = 9;
l_gridLayout.horizontalSpacing = 6;
l_gridLayout.verticalSpacing = 6;
this.label = new Label(this.centralwidget,SWT.NONE);
this.label.setText("Text Browser:");
this.textBrowser = new Browser(this.centralwidget,SWT.BORDER);
this.textBrowser.setText("<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\" white-space: pre-wrap; font-family:MS Shell Dlg 2; font-size:8.25pt; font-weight:400; font-style:normal; text-decoration:none;\"><p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\">The quick brown fox jumped over the lazy dog.</p></body></html>");
GridData l_gridData;
l_gridData = new GridData();
l_gridData.horizontalAlignment = GridData.FILL;
l_gridData.grabExcessHorizontalSpace = true;
l_gridData.verticalAlignment = GridData.CENTER;
l_gridData.grabExcessVerticalSpace = false;
this.label.setLayoutData(l_gridData);
l_gridData = new GridData();
l_gridData.horizontalAlignment = GridData.FILL;
l_gridData.grabExcessHorizontalSpace = true;
l_gridData.verticalAlignment = GridData.FILL;
l_gridData.grabExcessVerticalSpace = true;
this.textBrowser.setLayoutData(l_gridData);
iParent.setLayout(new FormLayout());
FormData l_formData;
l_formData = new FormData();
l_formData.top = new FormAttachment(0);
l_formData.left = new FormAttachment(0);
l_formData.right = new FormAttachment(100);
l_coolBar.setLayoutData(l_formData);
l_formData = new FormData();
l_formData.top = new FormAttachment(l_coolBar);
l_formData.left = new FormAttachment(0);
l_formData.right = new FormAttachment(100);
l_formData.bottom = new FormAttachment(100);
this.centralwidget.setLayoutData(l_formData);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -