added interface override annotations.
This commit is contained in:
parent
fc4c568b18
commit
5bbd8e4ef3
189 changed files with 1458 additions and 319 deletions
|
|
@ -78,6 +78,7 @@ public class SwtActionPanel implements VascEntryFrontendEventListener {
|
|||
rowNumberField = new Text(actionRow, SWT.NONE | SWT.BORDER);
|
||||
rowNumberField.setText(""+entry.getVascFrontendController().getVascEntryState().getVascBackendState().getPageSize()+" ");
|
||||
rowNumberField.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent arg0) {
|
||||
if (vascEvent) {
|
||||
return;
|
||||
|
|
@ -93,6 +94,7 @@ public class SwtActionPanel implements VascEntryFrontendEventListener {
|
|||
l.setText("Goto: ");
|
||||
pageBox = new Combo(actionRow,SWT.SINGLE | SWT.BORDER);
|
||||
pageBox.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
entry.getVascFrontendController().getVascFrontendActions().pageAction(pageBox.getSelectionIndex()-1);
|
||||
pageBox.select(0);
|
||||
|
|
@ -107,6 +109,7 @@ public class SwtActionPanel implements VascEntryFrontendEventListener {
|
|||
downloadBox.add(a.getName());
|
||||
}
|
||||
downloadBox.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
|
||||
downloadBox.select(0);
|
||||
|
|
@ -121,11 +124,13 @@ public class SwtActionPanel implements VascEntryFrontendEventListener {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener#getEventTypes()
|
||||
*/
|
||||
@Override
|
||||
public VascFrontendEventType[] getEventTypes() {
|
||||
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ};
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vascEvent(VascEntry entry,Serializable dataNotUsed) {
|
||||
vascEvent = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,11 +72,13 @@ public class SwtPagerPanel implements VascEntryFrontendEventListener {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.entry.VascEntryFrontendEventListener#getEventTypes()
|
||||
*/
|
||||
@Override
|
||||
public VascFrontendEventType[] getEventTypes() {
|
||||
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ};
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void vascEvent(VascEntry entry,Serializable dataNotUsed) {
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ public class SwtVascEditDialog extends Dialog {
|
|||
saveButton.setText(i18n("vasc.action.saveAction.name"));
|
||||
saveButton.setToolTipText(i18n("vasc.action.saveAction.description"));
|
||||
saveButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
try {
|
||||
boolean error = entry.getVascFrontendController().getVascFrontendHelper().validateAndSetErrorText(entry);
|
||||
|
|
@ -226,6 +227,7 @@ public class SwtVascEditDialog extends Dialog {
|
|||
cancelButton.setText(i18n("vasc.action.cancelAction.name"));
|
||||
cancelButton.setToolTipText(i18n("vasc.action.cancelAction.description"));
|
||||
cancelButton.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
entry.getVascFrontendController().getVascEntryState().setEntryDataObject(null);
|
||||
shell.dispose();
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.frontend.VascFrontend#getFrontendType()
|
||||
*/
|
||||
@Override
|
||||
public String getFrontendType() {
|
||||
return "swt";
|
||||
}
|
||||
|
|
@ -118,6 +119,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* Add swt implmented ui components
|
||||
*/
|
||||
@Override
|
||||
protected void addUiComponents() {
|
||||
VascFrontendController vfd = getVascEntry().getVascFrontendController();
|
||||
|
||||
|
|
@ -165,6 +167,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/** These filter extensions are used to filter which files are displayed. */
|
||||
private static final String[] FILTER_EXTS = { "*.*","*.csv","*.xls" };
|
||||
|
||||
@Override
|
||||
public void renderExport(VascEntryExport exporter) throws VascFrontendException {
|
||||
FileDialog dlg = new FileDialog(Display.getCurrent().getActiveShell(), SWT.SAVE);
|
||||
dlg.setFilterNames(FILTER_NAMES);
|
||||
|
|
@ -197,6 +200,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderEdit() throws VascFrontendException {
|
||||
logger.fine("Rending Edit View");
|
||||
SwtVascEditDialog dialog = new SwtVascEditDialog(entry);
|
||||
|
|
@ -207,6 +211,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderDelete() throws VascFrontendException {
|
||||
boolean del = askDelete( Display.getCurrent().getActiveShell() );
|
||||
if (del==false) {
|
||||
|
|
@ -227,7 +232,8 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderView() throws VascFrontendException {
|
||||
if (initOnce) {
|
||||
return;
|
||||
|
|
@ -350,6 +356,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
model.addListener(new VascOptionValueModelListener(option));
|
||||
model.setValue(option.getDefaultValue());
|
||||
model.addListener(new VascValueModelListener() {
|
||||
@Override
|
||||
public void valueUpdate(VascValueModel model) throws VascException {
|
||||
entry.getVascFrontendController().getVascFrontendActions().refreshData();// mm
|
||||
}
|
||||
|
|
@ -374,6 +381,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
|
||||
final Text text = new Text(headerRightOptions, SWT.NONE | SWT.BORDER );
|
||||
text.addModifyListener(new ModifyListener() {
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
String value = text.getText();
|
||||
entry.getVascFrontendController().getVascFrontendActions().searchAction(value);
|
||||
|
|
@ -434,12 +442,14 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void widgetDefaultSelected(SelectionEvent e) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
|
||||
*/
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
Serializable data = (Serializable) e.item.getData();
|
||||
logger.fine("Slecting data: "+data);
|
||||
|
|
@ -455,6 +465,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
|
||||
//Add sort indicator and sort data when column selected
|
||||
Listener sortListener = new Listener() {
|
||||
@Override
|
||||
public void handleEvent(Event e) {
|
||||
// determine new sort column and direction
|
||||
TableColumn sortColumn = table2.getSortColumn();
|
||||
|
|
@ -474,10 +485,12 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
|
||||
entry.getVascFrontendController().addVascEntryFrontendEventListener(new VascEntryFrontendEventListener() {
|
||||
private static final long serialVersionUID = -5558286028449368490L;
|
||||
@Override
|
||||
public VascFrontendEventType[] getEventTypes() {
|
||||
VascFrontendEventType[] result = {VascEntryFrontendEventListener.VascFrontendEventType.POST_READ};
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public void vascEvent(VascEntry entry,Serializable data) {
|
||||
tableViewer.refresh();
|
||||
table2.deselectAll();
|
||||
|
|
@ -526,6 +539,8 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
this.comp=comp;
|
||||
this.table=table;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void controlResized(ControlEvent e) {
|
||||
Rectangle area = comp.getClientArea();
|
||||
Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||
|
|
@ -551,6 +566,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
//column2.setWidth(width - column1.getWidth());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void controlMoved(ControlEvent e) {
|
||||
|
||||
}
|
||||
|
|
@ -610,6 +626,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
|
||||
*/
|
||||
@Override
|
||||
public Image getColumnImage(Object arg0, int arg1) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -617,6 +634,7 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
|
||||
*/
|
||||
@Override
|
||||
public String getColumnText(Object bean, int columnNumber) {
|
||||
|
||||
int col=0;
|
||||
|
|
@ -651,18 +669,21 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
|
||||
*/
|
||||
@Override
|
||||
public void addListener(ILabelProviderListener arg0) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLabelProperty(Object arg0, String arg1) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -670,31 +691,33 @@ public class SwtVascFrontend extends AbstractVascFrontend {
|
|||
/**
|
||||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
|
||||
*/
|
||||
@Override
|
||||
public void removeListener(ILabelProviderListener arg0) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ListConverterContentProvider implements IStructuredContentProvider {
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public Object[] getElements(Object obj) {
|
||||
return ((VascEntry)obj).getVascFrontendController().getVascEntryState().getEntryDataList().toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -50,6 +50,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
private Color orgBackgroundColor = null;
|
||||
private Color errorColor = null;
|
||||
|
||||
@Override
|
||||
public Object createComponent(final VascEntry entry,VascEntryField entryField,final VascValueModel model,Object gui) throws VascException {
|
||||
button = new Button((Composite)gui, SWT.CHECK);
|
||||
orgBackgroundColor = button.getBackground();
|
||||
|
|
@ -62,6 +63,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
}
|
||||
//button.setToolTipText(i18n("vasc.dialog.save.tooltip"));
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
Boolean value = button.getSelection();
|
||||
try {
|
||||
|
|
@ -78,6 +80,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#getErrorText()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorText() {
|
||||
if (button==null) {
|
||||
return null;
|
||||
|
|
@ -88,6 +91,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setErrorText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setErrorText(String text) {
|
||||
if (button==null) {
|
||||
return;
|
||||
|
|
@ -103,6 +107,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isDisabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !button.isEnabled();
|
||||
}
|
||||
|
|
@ -110,6 +115,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setDisabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
button.setEnabled(!disabled);
|
||||
}
|
||||
|
|
@ -117,6 +123,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isRendered()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRendered() {
|
||||
return button.isVisible();
|
||||
}
|
||||
|
|
@ -124,6 +131,7 @@ public class SwtBoolean implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setRendered(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setRendered(boolean rendered) {
|
||||
button.setVisible(rendered);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public class SwtButton implements VascUIComponent {
|
|||
private Color orgBackgroundColor = null;
|
||||
private Color errorColor = null;
|
||||
|
||||
@Override
|
||||
public Object createComponent(VascEntry table,VascEntryField entryField,VascValueModel model,Object gui) throws VascException {
|
||||
button = new Button((Composite)gui, SWT.NONE);
|
||||
orgBackgroundColor = button.getBackground();
|
||||
|
|
@ -57,6 +58,7 @@ public class SwtButton implements VascUIComponent {
|
|||
button.setText(model.getValue()+"");
|
||||
//button.setToolTipText(i18n("vasc.dialog.save.tooltip"));
|
||||
button.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
}
|
||||
});
|
||||
|
|
@ -66,6 +68,7 @@ public class SwtButton implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#getErrorText()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorText() {
|
||||
if (button==null) {
|
||||
return null;
|
||||
|
|
@ -76,6 +79,7 @@ public class SwtButton implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setErrorText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setErrorText(String text) {
|
||||
if (button==null) {
|
||||
return;
|
||||
|
|
@ -91,6 +95,7 @@ public class SwtButton implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isDisabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !button.isEnabled();
|
||||
}
|
||||
|
|
@ -98,6 +103,7 @@ public class SwtButton implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setDisabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
button.setEnabled(!disabled);
|
||||
}
|
||||
|
|
@ -105,6 +111,7 @@ public class SwtButton implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isRendered()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRendered() {
|
||||
return button.isVisible();
|
||||
}
|
||||
|
|
@ -112,6 +119,7 @@ public class SwtButton implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setRendered(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setRendered(boolean rendered) {
|
||||
button.setVisible(rendered);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
private Color orgBackgroundColor = null;
|
||||
private Color errorColor = null;
|
||||
|
||||
@Override
|
||||
public Object createComponent(VascEntry table,VascEntryField entryField,VascValueModel model,Object gui) throws VascException {
|
||||
label = new Label((Composite)gui, SWT.NONE);
|
||||
orgBackgroundColor = label.getBackground();
|
||||
|
|
@ -57,6 +58,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#getErrorText()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorText() {
|
||||
if (label==null) {
|
||||
return null;
|
||||
|
|
@ -67,6 +69,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setErrorText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setErrorText(String text) {
|
||||
if (label==null) {
|
||||
return;
|
||||
|
|
@ -82,6 +85,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isDisabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !label.isEnabled();
|
||||
}
|
||||
|
|
@ -89,6 +93,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setDisabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
label.setEnabled(!disabled);
|
||||
}
|
||||
|
|
@ -96,6 +101,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isRendered()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRendered() {
|
||||
return label.isVisible();
|
||||
}
|
||||
|
|
@ -103,6 +109,7 @@ public class SwtLabel implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setRendered(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setRendered(boolean rendered) {
|
||||
label.setVisible(rendered);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class SwtList implements VascUIComponent {
|
|||
private Color errorColor = null;
|
||||
private List<VascSelectItem> data = null;
|
||||
|
||||
@Override
|
||||
public Object createComponent(final VascEntry entry,VascEntryField entryField,final VascValueModel model,Object gui) throws VascException {
|
||||
combo = new Combo((Composite)gui,SWT.SINGLE | SWT.BORDER);
|
||||
combo.setVisibleItemCount(8);
|
||||
|
|
@ -67,6 +68,7 @@ public class SwtList implements VascUIComponent {
|
|||
orgBackgroundColor = combo.getBackground();
|
||||
errorColor = new Color(((Composite)gui).getDisplay(),255,0,0);
|
||||
combo.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
VascSelectItem item = findItem(combo.getText());
|
||||
if (item!=null) {
|
||||
|
|
@ -125,6 +127,7 @@ public class SwtList implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#getErrorText()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorText() {
|
||||
if (combo==null) {
|
||||
return null;
|
||||
|
|
@ -135,6 +138,7 @@ public class SwtList implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setErrorText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setErrorText(String text) {
|
||||
if (combo==null) {
|
||||
return;
|
||||
|
|
@ -150,6 +154,7 @@ public class SwtList implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isDisabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !combo.isEnabled();
|
||||
}
|
||||
|
|
@ -157,6 +162,7 @@ public class SwtList implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setDisabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
combo.setEnabled(!disabled);
|
||||
}
|
||||
|
|
@ -164,6 +170,7 @@ public class SwtList implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isRendered()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRendered() {
|
||||
return combo.isVisible();
|
||||
}
|
||||
|
|
@ -171,6 +178,7 @@ public class SwtList implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setRendered(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setRendered(boolean rendered) {
|
||||
combo.setVisible(rendered);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class SwtText implements VascUIComponent {
|
|||
private Color orgBackgroundColor = null;
|
||||
private Color errorColor = null;
|
||||
|
||||
@Override
|
||||
public Object createComponent(VascEntry entry,VascEntryField entryField,VascValueModel model,Object gui) throws VascException {
|
||||
text = new Text((Composite)gui, SWT.NONE | SWT.BORDER);
|
||||
orgBackgroundColor = text.getBackground();
|
||||
|
|
@ -72,7 +73,8 @@ public class SwtText implements VascUIComponent {
|
|||
this.model=model;
|
||||
this.entry=entry;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
Serializable value = text.getText();
|
||||
try {
|
||||
|
|
@ -86,6 +88,7 @@ public class SwtText implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#getErrorText()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorText() {
|
||||
if (text==null) {
|
||||
return null;
|
||||
|
|
@ -96,6 +99,7 @@ public class SwtText implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setErrorText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setErrorText(String textString) {
|
||||
if (text==null) {
|
||||
return;
|
||||
|
|
@ -111,6 +115,7 @@ public class SwtText implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isDisabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !text.isEnabled();
|
||||
}
|
||||
|
|
@ -118,6 +123,7 @@ public class SwtText implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setDisabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
text.setEnabled(!disabled);
|
||||
}
|
||||
|
|
@ -125,6 +131,7 @@ public class SwtText implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isRendered()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRendered() {
|
||||
return text.isVisible();
|
||||
}
|
||||
|
|
@ -132,6 +139,7 @@ public class SwtText implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setRendered(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setRendered(boolean rendered) {
|
||||
text.setVisible(rendered);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
private Color orgBackgroundColor = null;
|
||||
private Color errorColor = null;
|
||||
|
||||
@Override
|
||||
public Object createComponent(VascEntry entry,VascEntryField entryField,VascValueModel model,Object gui) throws VascException {
|
||||
text = new Text((Composite)gui, SWT.MULTI | SWT.BORDER);
|
||||
orgBackgroundColor = text.getBackground();
|
||||
|
|
@ -96,7 +97,8 @@ public class SwtTextArea implements VascUIComponent {
|
|||
this.model=model;
|
||||
this.entry=entry;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void modifyText(ModifyEvent e) {
|
||||
Serializable value = text.getText();
|
||||
try {
|
||||
|
|
@ -110,6 +112,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#getErrorText()
|
||||
*/
|
||||
@Override
|
||||
public String getErrorText() {
|
||||
if (text==null) {
|
||||
return null;
|
||||
|
|
@ -120,6 +123,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setErrorText(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void setErrorText(String textString) {
|
||||
if (text==null) {
|
||||
return;
|
||||
|
|
@ -135,6 +139,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isDisabled()
|
||||
*/
|
||||
@Override
|
||||
public boolean isDisabled() {
|
||||
return !text.isEnabled();
|
||||
}
|
||||
|
|
@ -142,6 +147,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setDisabled(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setDisabled(boolean disabled) {
|
||||
text.setEnabled(!disabled);
|
||||
}
|
||||
|
|
@ -149,6 +155,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#isRendered()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRendered() {
|
||||
return text.isVisible();
|
||||
}
|
||||
|
|
@ -156,6 +163,7 @@ public class SwtTextArea implements VascUIComponent {
|
|||
/**
|
||||
* @see net.forwardfire.vasc.core.ui.VascUIComponent#setRendered(boolean)
|
||||
*/
|
||||
@Override
|
||||
public void setRendered(boolean rendered) {
|
||||
text.setVisible(rendered);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ import junit.framework.TestCase;
|
|||
*/
|
||||
public class SWTTableViewerTest extends TestCase {
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
// enable all logs
|
||||
//InputStream loggingProperties = this.getClass().getResourceAsStream("/META-INF/logging.properties");
|
||||
|
|
@ -77,6 +78,7 @@ public class SWTTableViewerTest extends TestCase {
|
|||
new PersonEditor().run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
}
|
||||
|
||||
|
|
@ -129,6 +131,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* @param shell
|
||||
* the shell
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell shell) {
|
||||
super.configureShell(shell);
|
||||
shell.setText("Person Editor");
|
||||
|
|
@ -142,6 +145,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the main window
|
||||
* @return Control
|
||||
*/
|
||||
@Override
|
||||
protected Control createContents(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
composite.setLayout(new GridLayout(1, false));
|
||||
|
|
@ -174,6 +178,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
|
||||
// Add a new person when the user clicks button
|
||||
newPerson.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent event) {
|
||||
Person p = new Person();
|
||||
p.setName("Name");
|
||||
|
|
@ -220,6 +225,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
/**
|
||||
* Returns the Person objects
|
||||
*/
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
return ((List) inputElement).toArray();
|
||||
}
|
||||
|
|
@ -227,6 +233,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
/**
|
||||
* Disposes any created resources
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
// Do nothing
|
||||
}
|
||||
|
|
@ -234,6 +241,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
/**
|
||||
* Called when the input changes
|
||||
*/
|
||||
@Override
|
||||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
|
||||
// Ignore
|
||||
}
|
||||
|
|
@ -251,6 +259,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the data model
|
||||
* @return Object[]
|
||||
*/
|
||||
@Override
|
||||
public Object[] getElements(Object arg0) {
|
||||
return ((GroceryList) arg0).getFoods().toArray();
|
||||
}
|
||||
|
|
@ -258,6 +267,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
/**
|
||||
* Disposes any created resources
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
// Do nothing
|
||||
}
|
||||
|
|
@ -272,6 +282,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* @param arg2
|
||||
* the new input
|
||||
*/
|
||||
@Override
|
||||
public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
|
||||
// Do nothing
|
||||
}
|
||||
|
|
@ -297,6 +308,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the property
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean canModify(Object element, String property) {
|
||||
// Allow editing of all values
|
||||
return true;
|
||||
|
|
@ -311,6 +323,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the property
|
||||
* @return Object
|
||||
*/
|
||||
@Override
|
||||
public Object getValue(Object element, String property) {
|
||||
Person p = (Person) element;
|
||||
if (PersonEditor.NAME.equals(property))
|
||||
|
|
@ -335,6 +348,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* @param value
|
||||
* the value
|
||||
*/
|
||||
@Override
|
||||
public void modify(Object element, String property, Object value) {
|
||||
if (element instanceof Item)
|
||||
element = ((Item) element).getData();
|
||||
|
|
@ -522,6 +536,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the column index
|
||||
* @return Image
|
||||
*/
|
||||
@Override
|
||||
public Image getColumnImage(Object element, int columnIndex) {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -535,6 +550,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the column index
|
||||
* @return String
|
||||
*/
|
||||
@Override
|
||||
public String getColumnText(Object element, int columnIndex) {
|
||||
Person person = (Person) element;
|
||||
switch (columnIndex) {
|
||||
|
|
@ -556,6 +572,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* @param listener
|
||||
* the listener
|
||||
*/
|
||||
@Override
|
||||
public void addListener(ILabelProviderListener listener) {
|
||||
// Ignore it
|
||||
}
|
||||
|
|
@ -563,6 +580,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
/**
|
||||
* Disposes any created resources
|
||||
*/
|
||||
@Override
|
||||
public void dispose() {
|
||||
// Nothing to dispose
|
||||
}
|
||||
|
|
@ -577,6 +595,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* the property
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isLabelProperty(Object element, String property) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -587,6 +606,7 @@ class PersonEditor extends ApplicationWindow {
|
|||
* @param listener
|
||||
* the listener
|
||||
*/
|
||||
@Override
|
||||
public void removeListener(ILabelProviderListener listener) {
|
||||
// Ignore
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
|
|
@ -48,9 +50,11 @@ public class SWTTest extends TestCase {
|
|||
|
||||
private TestModelData testData = null;
|
||||
|
||||
@Override
|
||||
public void setUp() throws Exception {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tearDown() throws Exception {
|
||||
}
|
||||
public void testNull() throws Exception {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue