public static void main(String[] args) { try { PropertiesLoader loader = PropertiesLoader.getPropertiesLoader("com.deam.util.layout-label"); PrintedLumpWindow window = new PrintedLumpWindow(loader); window.open(); } catch (Exception e) { e.printStackTrace(); } }
/** Create contents of the window. */ protected void createContents() { shell = new Shell(); shell.setImage(SWTResourceManager.getImage(PrintedLumpWindow.class, "/icon/App.ico")); shell.setSize(457, 244); shell.setText(loader.getValue(LabelConstants.LAYOUT_PRINTED_LUMPS_NEW_PRINTED_LUMPS)); Label lblNameOfTheLump = new Label(shell, SWT.NONE); lblNameOfTheLump.setBounds(24, 38, 249, 15); lblNameOfTheLump.setText(loader.getValue(LabelConstants.LAYOUT_PRINTED_LUMPS_NAME_OF_THE_LUMP)); txtNameOfTheLump = new Text(shell, SWT.BORDER); txtNameOfTheLump.setBounds(20, 77, 397, 25); Button btnPrintedLumpCancel = new Button(shell, SWT.NONE); btnPrintedLumpCancel.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent arg0) { shell.setVisible(false); shell.dispose(); } }); btnPrintedLumpCancel.setBounds(20, 149, 105, 32); btnPrintedLumpCancel.setText(loader.getValue(LabelConstants.LAYOUT_CANCEL)); btnPrintedLumpSave = new Button(shell, SWT.NONE); btnPrintedLumpSave.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent arg0) { lumpsInterface.addPrintedLump(txtNameOfTheLump.getText()); shell.setVisible(false); shell.dispose(); } }); btnPrintedLumpSave.setBounds(312, 149, 105, 32); btnPrintedLumpSave.setText(loader.getValue(LabelConstants.LAYOUT_SAVE)); }