function DialogPanel = getDialogSchema(this, manager)
%  BUILD  Construct the dialog panel

%  Author(s): John Glass
%  Revised:
%  Copyright 2004-2011 The MathWorks, Inc.


%% Create the main button panel
DialogPanel = javaObjectEDT('com.mathworks.mwswing.MJPanel',false);
DialogPanel.setLayout(java.awt.BorderLayout);

%% Create the display scrollpane
TaskPanel = this.sisodb.getTaskPanel;
DialogPanel.add(TaskPanel,java.awt.BorderLayout.CENTER);

%% Add the delete listener
createDeleteListener(this)

%% Create the bottom button panel
ButtonPanel = javaObjectEDT('com.mathworks.mwswing.MJPanel',false);
ButtonPanel.setLayout(java.awt.FlowLayout(java.awt.FlowLayout.CENTER));

StoreDesignButton = javaObjectEDT('com.mathworks.mwswing.MJButton',...
    getString(message('Control:compDesignTask:strStoreDesign')));
StoreDesignButton.setName('StoreDesignButton');
h = handle(StoreDesignButton, 'callbackproperties' );
h.ActionPerformedCallback  = {@LocalStoreDesignButtonClicked,this};

ShowArchButton = javaObjectEDT('com.mathworks.mwswing.MJButton',...
    getString(message('Control:compDesignTask:strShowArchitecture')));
ShowArchButton.setName('ShowArchButton');
h = handle(ShowArchButton, 'callbackproperties' );
h.ActionPerformedCallback  = {@LocalShowDiagram this};

HelpButton = javaObjectEDT('com.mathworks.mwswing.MJButton',...
    getString(message('Control:compDesignTask:strHelp')));
HelpButton.setName('HelpButton');
h = handle(HelpButton, 'callbackproperties' );
h.ActionPerformedCallback  = {@LocalHelp this};

ButtonPanel.add(ShowArchButton);
ButtonPanel.add(StoreDesignButton);
ButtonPanel.add(HelpButton);

DialogPanel.add(ButtonPanel,java.awt.BorderLayout.SOUTH);

%% Configure a listener to the label changed event
this.addListeners(handle.listener(this,this.findprop('Label'),'PropertyPostSet',...
                        {@LocalLabelChanged, this}));

%% Store the handles
this.Handles.TaskPanel = TaskPanel;

%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Local Functions
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function LocalStoreDesignButtonClicked(~,~,this)

%% Get the folder to store the design
folder = this.getSnapshotFolder;

%% Store the design
folder.storeSnapshot;

%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function LocalShowDiagram(~,~,this)
% Show architecture diagram
this.sisodb.DesignTask.showDiagram;

%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function LocalHelp(~,~,this)
% Display help
this.sisodb.DesignTask.showPanelHelp;

%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function LocalLabelChanged(~,ed,this)

this.sisodb.LoopData.Name = ed.NewValue;