예제 #1
0
        // GET: User
        public ActionResult Index()
        {
            DefaultListModel model = new DefaultListModel()
            {
                TableName        = "tblUser",
                TargetArea       = Request.RequestContext.RouteData.DataTokens["area"].ToString(),
                ControllerName   = Request.RequestContext.RouteData.Values["controller"].ToString(),
                IsAllowAddUpdate = IsAllowAddUpdate
            };

            return(View(model));
        }
예제 #2
0
        private HttpResponseMessage GetContent(DESettings settings, DLBase defaultList)
        {
            HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
            string result = string.Empty;

            defaultList.Populate();
            DefaultListModel model = new DefaultListModel(defaultList.DEList);

            model.BackURL    = string.Format(model.BackURL, settings.BusinessUnit);
            result           = ViewRenderer.RenderView("~/Views/SystemDefaults/DefaultList.cshtml", model, null);
            response.Content = new StringContent(result);
            response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/html");
            return(response);
        }
        /// <summary>
        /// Set the annotation data and repopulate the list.
        /// </summary>
        public virtual void setAnnotationData(IList <StateMod_Network_AnnotationData> annotationDataList)
        {
            __annotationDataList = annotationDataList;
            IList <string> annotationLabelList = new List <string>(annotationDataList.Count);

            foreach (StateMod_Network_AnnotationData annotationData in annotationDataList)
            {
                annotationLabelList.Add(annotationData.getLabel());
            }
            // Sort the array before adding
            annotationLabelList.Sort();
            __annotationJListModel = new DefaultListModel();
            foreach (string annotationLabel in annotationLabelList)
            {
                __annotationJListModel.addElement(annotationLabel);
            }
            __annotationJList.setModel(__annotationJListModel);
            checkVisibility();
        }
예제 #4
0
 private void InitBlock(FactEditor enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     listModel = new DefaultListModel();
 }
예제 #5
0
 private void InitBlock()
 {
     dumpAreaTemplate = new JTextArea();
     dumpAreaFact = new JTextArea();
     moduleListModel = new DefaultListModel();
     templateListModel = new DefaultListModel();
     factComponents = new HashMap();
 }
예제 #6
0
    //--------
    //-------- Constructors
    //--------

    /// <summary>
    /// Constructor a frame to contain the device data.  Provide
    /// the device and the log file name
    /// </summary>
    public TagMainFrame() : base("1-Wire Tag Viewer")
    {
        // construct the frame

        //set the look and feel to the system look and feel
        try
        {
            UIManager.LookAndFeel = UIManager.SystemLookAndFeelClassName;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.ToString());
            Console.Write(e.StackTrace);
        }

        // add an event listener to end the aplication when the frame is closed
        addWindowListener(new WindowAdapterAnonymousInnerClassHelper(this, e));

        // create the main panel
        mainPanel = new JPanel(new BorderLayout(10, 10));

        // create the sub-pannels
        northPanel        = new JPanel();
        northPanel.Border = BorderFactory.createLoweredBevelBorder();

        centerPanel        = new JPanel();
        centerPanel.Layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);

        southPanel        = new JPanel();
        southPanel.Layout = new BoxLayout(southPanel, BoxLayout.Y_AXIS);
        southPanel.Border = BorderFactory.createLoweredBevelBorder();

        westPanel        = new JPanel();
        westPanel.Border = BorderFactory.createRaisedBevelBorder();
        westPanel.Border = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        eastPanel        = new JPanel();
        eastPanel.Border = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        // fill the panels

        // north
        logLabel = new JLabel("Log Filename: ");
        northPanel.add(logLabel);

        logField = new JTextField("log.txt", 20);
        logField.addActionListener(this);
        northPanel.add(logField);

        // center
        listData = new DefaultListModel();
        listData.addElement("                                                                     ");
        listData.addElement("                                                                     ");
        listData.addElement("                                                                     ");
        listData.addElement("                                                                     ");
        pathList = new JList(listData);
        pathList.VisibleRowCount = 5;
        scrollPanel        = new JScrollPane(pathList);
        scrollPanel.Border = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "1-Wire Paths to Search");
        centerPanel.add(scrollPanel);

        // west
        scanCheck = new JCheckBox("Scan 1-Wire Paths for XML Tags", false);
        scanCheck.addActionListener(this);
        westPanel.add(scanCheck);

        // south
        portLabel = new JLabel("Adapter:");
        southPanel.add(portLabel);

        statusLabel = new JLabel("Status:");
        southPanel.add(statusLabel);

        // add to main
        mainPanel.add(northPanel, BorderLayout.NORTH);
        mainPanel.add(centerPanel, BorderLayout.CENTER);
        mainPanel.add(southPanel, BorderLayout.SOUTH);
        mainPanel.add(eastPanel, BorderLayout.EAST);
        mainPanel.add(westPanel, BorderLayout.WEST);

        // add to frame
        ContentPane.add(mainPanel);

        // pack the frame
        pack();

        // resize the window and put in random location
        Dimension current_sz = Size;

        Size = new Dimension(current_sz.width * 5 / 4, current_sz.height);
        Toolkit   tool = Toolkit.DefaultToolkit;
        Dimension mx   = tool.ScreenSize;
        Dimension sz   = Size;
        Random    rand = new Random();

        setLocation((mx.width - sz.width) / 2, (mx.height - sz.height) / 2);

        // clear out the listbox data
        listData.removeAllElements();

        // make visible
        Visible = true;
    }