-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added hierarchy tree selection for scale value cards
- Loading branch information
Showing
6 changed files
with
57 additions
and
62 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
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
12 changes: 4 additions & 8 deletions
12
...nt/postcoordination/scaleValuesCard/scaleValueSelectionModal/ScaleValueSelectionView.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 |
---|---|---|
@@ -1,16 +1,12 @@ | ||
package edu.stanford.bmir.protege.web.client.postcoordination.scaleValuesCard.scaleValueSelectionModal; | ||
|
||
import com.google.gwt.user.client.ui.IsWidget; | ||
import edu.stanford.bmir.protege.web.client.postcoordination.scaleValuesCard.ScaleAllowMultiValue; | ||
import com.google.gwt.user.client.ui.*; | ||
import edu.stanford.bmir.protege.web.client.progress.HasBusy; | ||
|
||
import java.util.List; | ||
import javax.annotation.Nonnull; | ||
|
||
public interface ScaleValueSelectionView extends IsWidget, HasBusy { | ||
|
||
void clear(); | ||
|
||
List<String> getText(); | ||
|
||
void setTopClass(String scaleTopClass); | ||
@Nonnull | ||
AcceptsOneWidget getHierarchyContainer(); | ||
} |
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
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
45 changes: 28 additions & 17 deletions
45
...ordination/scaleValuesCard/scaleValueSelectionModal/ScaleValueSelectionViewPresenter.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 |
---|---|---|
@@ -1,46 +1,57 @@ | ||
package edu.stanford.bmir.protege.web.client.postcoordination.scaleValuesCard.scaleValueSelectionModal; | ||
|
||
import edu.stanford.bmir.protege.web.client.library.modal.ModalManager; | ||
import edu.stanford.bmir.protege.web.client.postcoordination.scaleValuesCard.ScaleAllowMultiValue; | ||
import edu.stanford.bmir.protege.web.client.hierarchy.*; | ||
import edu.stanford.bmir.protege.web.shared.entity.EntityNode; | ||
import edu.stanford.bmir.protege.web.shared.event.WebProtegeEventBus; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.inject.Inject; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public class ScaleValueSelectionViewPresenter { | ||
|
||
private ScaleValueSelectionView view; | ||
private ScaleAllowMultiValue scaleAllowMultiValue; | ||
private String scaleTopClass; | ||
|
||
@Nonnull | ||
private final ModalManager modalManager; | ||
private final HierarchyPopupView hierarchyView; | ||
|
||
@Nonnull | ||
private final EntityHierarchyModel model; | ||
|
||
private Optional<EntityNode> selectedEntity = Optional.empty(); | ||
|
||
|
||
@Inject | ||
public ScaleValueSelectionViewPresenter(ScaleValueSelectionView view, | ||
@Nonnull ModalManager modalManager) { | ||
@Nonnull HierarchyPopupView hierarchyView, | ||
@Nonnull EntityHierarchyModel model) { | ||
this.view = view; | ||
this.modalManager = modalManager; | ||
this.hierarchyView = hierarchyView; | ||
this.model = model; | ||
} | ||
|
||
@Nonnull | ||
public ScaleValueSelectionView getView() { | ||
return view; | ||
} | ||
|
||
public void start() { | ||
} | ||
public void start(WebProtegeEventBus eventBus, HierarchyDescriptor hierarchyDescriptor) { | ||
this.clean(); | ||
model.start(eventBus, | ||
hierarchyDescriptor); | ||
hierarchyView.setModel(model); | ||
hierarchyView.setSelectionChangedHandler( | ||
entityNode -> selectedEntity = Optional.of(entityNode) | ||
); | ||
this.view.getHierarchyContainer().setWidget(hierarchyView); | ||
|
||
public List<String> getSelections() { | ||
return view.getText(); | ||
} | ||
|
||
public void setAllowMultiValue(ScaleAllowMultiValue scaleAllowMultiValue) { | ||
this.scaleAllowMultiValue = scaleAllowMultiValue; | ||
public Optional<EntityNode> getSelection() { | ||
return selectedEntity; | ||
} | ||
|
||
public void setScaleTopClass(String scaleTopClass) { | ||
this.scaleTopClass = scaleTopClass; | ||
this.view.setTopClass(scaleTopClass); | ||
private void clean() { | ||
this.selectedEntity = Optional.empty(); | ||
} | ||
} |