-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PT-138] remove realized pnl label in Current Position view
- Loading branch information
yujunfeng
committed
Nov 9, 2015
1 parent
9f6dd63
commit c50dc88
Showing
10 changed files
with
320 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
CSTW/src/com/cyanspring/cstw/model/admin/ExchangeAccountModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.cyanspring.cstw.model.admin; | ||
|
||
/** | ||
* | ||
* @author NingXiaoFeng | ||
* @create date 2015/06/11 | ||
* | ||
*/ | ||
public final class ExchangeAccountModel { | ||
|
||
private String id; | ||
|
||
private String name; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
CSTW/src/com/cyanspring/cstw/model/admin/StockPoolModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.cyanspring.cstw.model.admin; | ||
|
||
/** | ||
* | ||
* @author NingXiaoFeng | ||
* @create date 2015/05/20 | ||
* | ||
*/ | ||
public final class StockPoolModel { | ||
|
||
private String id; | ||
|
||
private String name; | ||
|
||
private SubAccountModel relativeAccount; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public SubAccountModel getRelativeAccount() { | ||
return relativeAccount; | ||
} | ||
|
||
public void setRelativeAccount(SubAccountModel relativeAccount) { | ||
this.relativeAccount = relativeAccount; | ||
} | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
CSTW/src/com/cyanspring/cstw/model/admin/SubAccountModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.cyanspring.cstw.model.admin; | ||
|
||
|
||
/** | ||
* | ||
* @author NingXiaoFeng | ||
* @create date 2015/05/19 | ||
* | ||
*/ | ||
public final class SubAccountModel { | ||
|
||
private String id; | ||
|
||
private String name; | ||
|
||
private ExchangeAccountModel exchangeAccountModel; | ||
|
||
private double useableMoney; | ||
|
||
private double commissionRate; | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public ExchangeAccountModel getExchangeAccountModel() { | ||
return exchangeAccountModel; | ||
} | ||
|
||
public void setExchangeAccountModel( | ||
ExchangeAccountModel exchangeAccountModel) { | ||
this.exchangeAccountModel = exchangeAccountModel; | ||
} | ||
|
||
public double getUseableMoney() { | ||
return useableMoney; | ||
} | ||
|
||
public void setUseableMoney(double useableMoney) { | ||
this.useableMoney = useableMoney; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public double getCommissionRate() { | ||
return commissionRate; | ||
} | ||
|
||
public void setCommissionRate(double commissionRate) { | ||
this.commissionRate = commissionRate; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
CSTW/src/com/cyanspring/cstw/ui/forms/EditTreeContentProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.cyanspring.cstw.ui.forms; | ||
|
||
import org.eclipse.jface.viewers.IContentProvider; | ||
import org.eclipse.jface.viewers.Viewer; | ||
|
||
/** | ||
* @author Junfeng | ||
* @create 9 Nov 2015 | ||
*/ | ||
public class EditTreeContentProvider implements IContentProvider { | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.viewers.IContentProvider#dispose() | ||
*/ | ||
@Override | ||
public void dispose() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object) | ||
*/ | ||
@Override | ||
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
48 changes: 48 additions & 0 deletions
48
CSTW/src/com/cyanspring/cstw/ui/forms/EditTreeLabelProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.cyanspring.cstw.ui.forms; | ||
|
||
import org.eclipse.jface.viewers.IBaseLabelProvider; | ||
import org.eclipse.jface.viewers.ILabelProviderListener; | ||
|
||
/** | ||
* @author Junfeng | ||
* @create 9 Nov 2015 | ||
*/ | ||
public class EditTreeLabelProvider implements IBaseLabelProvider { | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) | ||
*/ | ||
@Override | ||
public void addListener(ILabelProviderListener listener) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() | ||
*/ | ||
@Override | ||
public void dispose() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String) | ||
*/ | ||
@Override | ||
public boolean isLabelProperty(Object element, String property) { | ||
// TODO Auto-generated method stub | ||
return false; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) | ||
*/ | ||
@Override | ||
public void removeListener(ILabelProviderListener listener) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
104 changes: 104 additions & 0 deletions
104
CSTW/src/com/cyanspring/cstw/ui/forms/SubAccountManageMasterDetailBlock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package com.cyanspring.cstw.ui.forms; | ||
|
||
import org.eclipse.jface.viewers.ISelectionChangedListener; | ||
import org.eclipse.jface.viewers.SelectionChangedEvent; | ||
import org.eclipse.jface.viewers.TreeViewer; | ||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.layout.GridData; | ||
import org.eclipse.swt.layout.GridLayout; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.eclipse.swt.widgets.Label; | ||
import org.eclipse.swt.widgets.Tree; | ||
import org.eclipse.ui.forms.DetailsPart; | ||
import org.eclipse.ui.forms.IManagedForm; | ||
import org.eclipse.ui.forms.MasterDetailsBlock; | ||
import org.eclipse.ui.forms.SectionPart; | ||
import org.eclipse.ui.forms.widgets.FormToolkit; | ||
import org.eclipse.ui.forms.widgets.Section; | ||
import org.eclipse.ui.forms.widgets.TableWrapData; | ||
|
||
/** | ||
* @author Junfeng | ||
* @create 9 Nov 2015 | ||
*/ | ||
public class SubAccountManageMasterDetailBlock extends MasterDetailsBlock { | ||
|
||
private FormToolkit toolkit; | ||
private TreeViewer editTree; | ||
private Object rootList; | ||
|
||
@Override | ||
protected void createMasterPart(final IManagedForm managedForm, Composite parent) { | ||
toolkit = managedForm.getToolkit(); | ||
Section dataSection = toolkit.createSection(parent, Section.COMPACT | Section.TITLE_BAR | Section.EXPANDED); | ||
TableWrapData td = new TableWrapData(TableWrapData.FILL_GRAB); | ||
td.colspan = 1; | ||
dataSection.setLayoutData(td); | ||
dataSection.setText("Edit Tree"); | ||
|
||
Composite sectionClient = toolkit.createComposite(dataSection, SWT.WRAP); | ||
GridLayout clientLayout = new GridLayout(); | ||
clientLayout.numColumns = 2; | ||
sectionClient.setLayout(clientLayout); | ||
|
||
GridData gd = new GridData(); | ||
gd.horizontalSpan = 2; | ||
Label label = toolkit.createLabel(sectionClient, ""); | ||
label.setLayoutData(gd); | ||
|
||
final SectionPart spart = new SectionPart(dataSection); | ||
managedForm.addPart(spart); | ||
|
||
GridData data = new GridData(SWT.LEFT, SWT.FILL, false, false); | ||
Tree memberTree = toolkit.createTree(sectionClient, SWT.NONE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER ); | ||
data = new GridData(SWT.FILL, SWT.FILL, true, true); | ||
data.heightHint = 200; | ||
data.widthHint = 200; | ||
memberTree.setLayoutData(data); | ||
editTree = new TreeViewer(memberTree); | ||
editTree.setContentProvider(new EditTreeContentProvider()); | ||
editTree.setLabelProvider(new EditTreeLabelProvider()); | ||
// register SelectionListener | ||
editTree.addSelectionChangedListener(new ISelectionChangedListener() { | ||
|
||
public void selectionChanged(SelectionChangedEvent event) { | ||
managedForm.fireSelectionChanged(spart, event.getSelection()); | ||
} | ||
}); | ||
|
||
editTree.addSelectionChangedListener(new ISelectionChangedListener() { | ||
|
||
public void selectionChanged(SelectionChangedEvent event) { | ||
changeUiElementState(); | ||
|
||
} | ||
}); | ||
refreshTree(); | ||
|
||
dataSection.setClient(sectionClient); | ||
} | ||
|
||
private void refreshTree() { | ||
editTree.setInput(rootList); | ||
editTree.expandToLevel(3); | ||
editTree.refresh(); | ||
} | ||
|
||
private void changeUiElementState() { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
protected void registerPages(DetailsPart detailsPart) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
protected void createToolBarActions(IManagedForm managedForm) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.