Skip to content

Commit

Permalink
wip support hierarchy change
Browse files Browse the repository at this point in the history
  • Loading branch information
soimugeo committed May 16, 2024
1 parent 3017f36 commit 16a1a86
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package edu.stanford.bmir.protege.web.client.hierarchy.parents;

import edu.stanford.bmir.protege.web.client.dispatch.DispatchServiceManager;
import edu.stanford.bmir.protege.web.shared.project.ProjectId;
import edu.stanford.bmir.protege.web.shared.renderer.GetEntityRenderingAction;
import org.semanticweb.owlapi.model.EntityType;
import org.semanticweb.owlapi.model.OWLEntity;

Expand All @@ -16,6 +18,9 @@ public class EditParentsPresenter {
@Nonnull
private final EditParentsView view;

@Nonnull
private final DispatchServiceManager dispatch;

@Nonnull
private EntityType<?> entityType = EntityType.CLASS;

Expand All @@ -24,14 +29,16 @@ public class EditParentsPresenter {

@Inject
public EditParentsPresenter(@Nonnull ProjectId projectId,
@Nonnull EditParentsView view) {
@Nonnull EditParentsView view, @Nonnull DispatchServiceManager dispatch) {
this.projectId = projectId;
this.view = view;
this.dispatch = dispatch;
}

public void start(@Nonnull OWLEntity entity) {
this.entity = entity;
this.view.setOwlEntity(entity);
dispatch.execute(GetEntityRenderingAction.create(projectId, entity),
result -> view.setOwlEntityData(result.getEntityData()));
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import javax.annotation.Nonnull;
import javax.inject.Inject;

import static com.google.common.base.Preconditions.checkNotNull;

public class EditParentsUiAction extends AbstractUiAction {

@Nonnull
Expand Down Expand Up @@ -44,7 +42,7 @@ public void execute() {

private void showDialog(OWLEntity entity) {
ModalPresenter modalPresenter = modalManager.createPresenter();
modalPresenter.setTitle(messages.tags_entityTags());
modalPresenter.setTitle(messages.hierarchy_editParents());
modalPresenter.setView(editParentsPresenter.getView());
editParentsPresenter.start(entity);
modalPresenter.setEscapeButton(DialogButton.CANCEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import com.google.gwt.user.client.ui.IsWidget;
import edu.stanford.bmir.protege.web.client.progress.HasBusy;
import org.semanticweb.owlapi.model.OWLEntity;
import edu.stanford.bmir.protege.web.shared.entity.OWLEntityData;

public interface EditParentsView extends IsWidget, HasBusy {
void setOwlEntity(OWLEntity entity);

void setOwlEntityData(OWLEntityData entityData);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import edu.stanford.bmir.protege.web.client.primitive.PrimitiveDataEditor;
import edu.stanford.bmir.protege.web.client.primitive.PrimitiveDataListEditor;
import edu.stanford.bmir.protege.web.shared.PrimitiveType;
import org.semanticweb.owlapi.model.OWLEntity;
import edu.stanford.bmir.protege.web.shared.entity.OWLEntityData;

import javax.annotation.Nonnull;
import javax.inject.Inject;
Expand All @@ -21,7 +21,7 @@ public class EditParentsViewImpl extends Composite implements EditParentsView {
@UiField
ExpandingTextBoxImpl textBox;

private OWLEntity entity;
private OWLEntityData entityData;

private final Messages messages;

Expand All @@ -41,6 +41,7 @@ public EditParentsViewImpl(Provider<PrimitiveDataEditor> primitiveDataEditorProv
this.messages = messages;
domains = new PrimitiveDataListEditor(primitiveDataEditorProvider, PrimitiveType.CLASS);
domains.setPlaceholder(messages.frame_enterAClassName());
// domains.setValue(Collections.singletonList(entityData));
textBox.setEnabled(false);
initWidget(ourUiBinder.createAndBindUi(this));
}
Expand All @@ -52,7 +53,7 @@ public void setBusy(boolean busy) {
}

@Override
public void setOwlEntity(OWLEntity entity) {
this.entity = entity;
public void setOwlEntityData(OWLEntityData entity) {
this.entityData = entity;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
anchorVisible="false"/>
</div>
<div class="{wp.style.formGroup}">
<g:Label text="{msg.frame_domain}" addStyleNames="{wp.style.formLabel}"/>
<g:Label text="{msg.hierarchy_parents}" addStyleNames="{wp.style.formLabel}"/>
<wp:PrimitiveDataListEditor ui:field="domains"/>
</div>
</g:HTMLPanel>
Expand Down

0 comments on commit 16a1a86

Please sign in to comment.