Skip to content

Commit

Permalink
Revert "Solving #592 - there is only one button for creating DPU temp…
Browse files Browse the repository at this point in the history
…lates"

This reverts commit d51786b.
  • Loading branch information
tomas-knap committed Oct 17, 2016
1 parent aca4b05 commit cb0169e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ public class DPUTree extends CustomComponent {

private boolean isValid = true;

public boolean isShowButtonCreateTemplate() {
return showButtonCreateTemplate;
}

public void setShowButtonCreateTemplate(boolean showButtonCreateTemplate) {
this.showButtonCreateTemplate = showButtonCreateTemplate;
}

private boolean showButtonCreateTemplate = true;

/**
* Creates new DPUTree.
*/
Expand Down Expand Up @@ -195,30 +185,28 @@ public void buttonClick(Button.ClickEvent event) {
topLine.setVisible(isExpandable);
mainLayout.addComponent(topLine);

if (showButtonCreateTemplate) {
buttonCreateDPU = new Button();
buttonCreateDPU.setCaption(Messages.getString("DPUTree.create.dpu"));
buttonCreateDPU.setHeight("25px");
buttonCreateDPU.setWidth("180px");
buttonCreateDPU
.addClickListener(new Button.ClickListener() {
private static final long serialVersionUID = 1L;

@Override
public void buttonClick(Button.ClickEvent event) {
//Open the dialog for DPU Template creation
if (!UI.getCurrent().getWindows().contains(createDPU)) {
createDPU.initClean();
UI.getCurrent().addWindow(createDPU);
createDPU.removeCloseListener(createDPUCloseListener);
createDPU.addCloseListener(createDPUCloseListener);
} else {
createDPU.bringToFront();
}

buttonCreateDPU = new Button();
buttonCreateDPU.setCaption(Messages.getString("DPUTree.create.dpu"));
buttonCreateDPU.setHeight("25px");
buttonCreateDPU.setWidth("180px");
buttonCreateDPU
.addClickListener(new Button.ClickListener() {
private static final long serialVersionUID = 1L;

@Override
public void buttonClick(Button.ClickEvent event) {
//Open the dialog for DPU Template creation
if (!UI.getCurrent().getWindows().contains(createDPU)) {
createDPU.initClean();
UI.getCurrent().addWindow(createDPU);
createDPU.removeCloseListener(createDPUCloseListener);
createDPU.addCloseListener(createDPUCloseListener);
} else {
createDPU.bringToFront();
}
});
}

}
});

exportButton = new Button(Messages.getString("DPUTree.export.dpu"));
exportButton.setHeight("25px");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ private HorizontalLayout buildDpuLayout() {

//DPU Template Tree
dpuTree.setExpandable(false);
dpuTree.setShowButtonCreateTemplate(false);
dpuTree.fillTree();
if (dpuTree.getListeners(ItemClickEvent.class).isEmpty()) {
dpuTree.addItemClickListener(new ItemClickEvent.ItemClickListener() {
Expand Down

0 comments on commit cb0169e

Please sign in to comment.