Skip to content

Commit

Permalink
Remove unused logic and feature flag check
Browse files Browse the repository at this point in the history
  • Loading branch information
SusanRatiLane committed Oct 17, 2023
1 parent 2b1a9ce commit a588409
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ private SourceStructureBox() {
false); // removable

// Creates the child instance according to the enabled features.
SUBINSTANCE = AppInventorFeatures.enableFutureFeatures()
? new SourceStructureBoxNew(this)
: new SourceStructureBoxClassic();
SUBINSTANCE = new SourceStructureBoxFilter(this);

setContent(SUBINSTANCE.getSourceStructureExplorer());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
/**
* Box implementation for source structure explorer (new style, with filters).
*/
public final class SourceStructureBoxNew implements ISourceStructureBox {
public final class SourceStructureBoxFilter implements ISourceStructureBox {
private Integer view = 1;

private final DropDownButton dropDownButton;
private final SourceStructureExplorer sourceStructureExplorer = new SourceStructureExplorer(false);
private final SourceStructureExplorer sourceStructureExplorer = new SourceStructureExplorer();

/**
* Creates new source structure explorer box.
*/
public SourceStructureBoxNew(SourceStructureBox container) {
public SourceStructureBoxFilter(SourceStructureBox container) {
super();

List<DropDownItem> items = new ArrayList<>();
Expand Down Expand Up @@ -105,7 +105,7 @@ public void execute() {
MockForm form = ((YaFormEditor) Ode.getInstance().getCurrentFileEditor()).getForm();
sourceStructureExplorer.updateTree(form.buildComponentsTree(view),
form.getForm().getLastSelectedComponent().getSourceStructureExplorerItem());
SourceStructureBoxNew.this.setView(view);
SourceStructureBoxFilter.this.setView(view);

updateSourceDropdownButtonCaption();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,10 @@ public void onBrowserEvent(Event event) {
}
}

public SourceStructureExplorer() {
this(true);
}

/**
* Creates a new source structure explorer.
*/
public SourceStructureExplorer(boolean includeButtonPanel) {
public SourceStructureExplorer() {
// Initialize UI elements
tree = new EventCaptureTree(Ode.getImageBundle());
tree.setAnimationEnabled(true);
Expand Down Expand Up @@ -178,12 +174,6 @@ public void onClick(ClickEvent event) {

VerticalPanel panel = new VerticalPanel();
panel.add(scrollPanel);
// TODO([email protected]): With App Inventor's current layout, as of now this is the only place to
// render these buttons...
// if (includeButtonPanel) {
panel.add(new Label());
panel.add(buttonPanel);
// }
panel.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_CENTER);
initWidget(panel);
}
Expand Down

0 comments on commit a588409

Please sign in to comment.