void generateFields(Operation op) {

		params = op.getParameters();
		crtOp = op;

		int totalSize = params.size();

		/*
		 * Pentru fiecare parametru se creeaza un panel continand un label cu
		 * numele parametrului si un element grafic pentru introducerea datelor,
		 * generat in functie de tipul parametrului:
		 * JTextField -> pentru parametri de tip String
		 * JComboBox -> pentru parametri tip enumeratie
		 * JSpinner -> pentru parametri numerici
		 */
		
		for (int ii = 2; ii < op.getParameters().size(); ii++) {

			SimpleTypeParameter param = op.getParameters().get(ii);

			paramsPanel.add(Box.createVerticalStrut(10));
			param1Panel = new JPanel();
			param1Panel.setPreferredSize(new Dimension(320, 30));
			param1Panel.setMinimumSize(new Dimension(320, 30));
			param1Panel.setMaximumSize(new Dimension(320, 30));
			paramsPanel.add(param1Panel);
			param1Panel.setLayout(new BoxLayout(param1Panel, BoxLayout.X_AXIS));

			horizontalStrut_1 = Box.createHorizontalStrut(20);
			horizontalStrut_1.setPreferredSize(new Dimension(10, 0));
			horizontalStrut_1.setMinimumSize(new Dimension(10, 0));
			horizontalStrut_1.setMaximumSize(new Dimension(10, 32767));
			param1Panel.add(horizontalStrut_1);

			elemName = new JLabel(param.getName());
			elemName.setPreferredSize(new Dimension(100, 15));
			elemName.setMinimumSize(new Dimension(100, 15));
			elemName.setMaximumSize(new Dimension(100, 15));
			elemName.setHorizontalAlignment(SwingConstants.RIGHT);
			param1Panel.add(elemName);

			horizontalStrut_2 = Box.createHorizontalStrut(20);
			horizontalStrut_2.setMaximumSize(new Dimension(10, 32767));
			horizontalStrut_2.setMinimumSize(new Dimension(10, 0));
			horizontalStrut_2.setPreferredSize(new Dimension(10, 0));
			param1Panel.add(horizontalStrut_2);

			// in functie de tipul parametrului, genereaza elementul grafic asociat

			// caz special - cand parametrul are restrictie de tip enumeration

			if (param.getRestrictions().enumeration != null) {

				JComboBox<String> elem = new JComboBox<String>(
						new DefaultComboBoxModel<String>(
								param.getRestrictions().enumeration));
				elem.setPreferredSize(new Dimension(150, 25));
				elem.setMinimumSize(new Dimension(150, 25));
				elem.setMaximumSize(new Dimension(150, 25));
				param1Panel.add(elem);

				graphicElements.add(elem);
				combos.add(elem);

			} else {

				String type = param.getBaseType();

				if (type.equals("decimal") || type.equals("float")
						|| type.equals("double")) {

					/*
					 *  daca exista restrictii de tipul minVal / maxVal, atunci
					 *  spinner-ul sa nu permita introducerea acestor valori
					 */
					double minValue = -1000.000;
					double maxValue = 1000.000;

					if (param.getRestrictions().minValue != null) {

						minValue = Double
								.parseDouble(param.getRestrictions().minValue);
					}

					if (param.getRestrictions().maxValue != null) {

						maxValue = Double
								.parseDouble(param.getRestrictions().maxValue);
					}

					SpinnerNumberModel spinnerModel = new SpinnerNumberModel(
							Math.max(minValue, 0), minValue, maxValue, 0.001);

					JSpinner elem = new JSpinner(spinnerModel);
					elem.setPreferredSize(new Dimension(150, 25));
					elem.setMinimumSize(new Dimension(150, 25));
					elem.setMaximumSize(new Dimension(150, 25));
					JComponent comp = elem.getEditor();
					JFormattedTextField field = (JFormattedTextField) comp
							.getComponent(0);
					DefaultFormatter formatter = (DefaultFormatter) field
							.getFormatter();
					formatter.setCommitsOnValidEdit(true);
					param1Panel.add(elem);

					graphicElements.add(elem);
					spinners.add(elem);
				}

				if (type.equals("integer") || type.equals("int")
						|| type.equals("negativeInteger")
						|| type.equals("nonNegativeInteger")
						|| type.equals("nonPositiveInteger")
						|| type.equals("positiveInteger")) {

					int minValue = -1000;
					int maxValue = 1000;

					if (type.equals("negativeInteger")) {

						maxValue = -1;
					}

					if (type.equals("nonNegativeInteger")) {

						minValue = 0;
					}

					if (type.equals("nonPositiveInteger")) {

						maxValue = 0;
					}

					if (type.equals("positiveInteger")) {

						minValue = 1;
					}

					// presupunem ca minValue si maxvalue sunt date corect,
					// tinand cont de restrictia de tip
					if (param.getRestrictions().minValue != null) {

						minValue = Integer
								.parseInt(param.getRestrictions().minValue);
					}

					if (param.getRestrictions().maxValue != null) {

						maxValue = Integer
								.parseInt(param.getRestrictions().maxValue);
					}

					SpinnerNumberModel spinnerModel = new SpinnerNumberModel(
							Math.max(minValue, 0), minValue, maxValue, 1);

					JSpinner elem = new JSpinner(spinnerModel);
					elem.setPreferredSize(new Dimension(150, 25));
					elem.setMinimumSize(new Dimension(150, 25));
					elem.setMaximumSize(new Dimension(150, 25));
					JComponent comp = elem.getEditor();
					JFormattedTextField field = (JFormattedTextField) comp
							.getComponent(0);
					DefaultFormatter formatter = (DefaultFormatter) field
							.getFormatter();
					param1Panel.add(elem);

					graphicElements.add(elem);
					spinners.add(elem);
				}

				if (type.equals("string")) {

					JTextField elem = new JTextField();
					elem.setPreferredSize(new Dimension(150, 25));
					elem.setMinimumSize(new Dimension(150, 25));
					elem.setMaximumSize(new Dimension(150, 25));
					param1Panel.add(elem);
					elem.setColumns(10);

					elem.addCaretListener(new CaretListener() {
						public void caretUpdate(CaretEvent e) {

							errorLabel.setText("");
						}
					});

					graphicElements.add(elem);
					textFields.add(elem);
				}

			}

			// daca e de tip complex, atunci se va crea un panel in care vor fi
			// adaugate si atributele
			if (param instanceof ComplexTypeParameter) {

				createAttributesFields((ComplexTypeParameter) param);
				totalSize += ((ComplexTypeParameter) param).getAttributes()
						.size() + 1;
			}

			horizontalStrut_3 = Box.createHorizontalStrut(20);
			horizontalStrut_3.setPreferredSize(new Dimension(10, 0));
			horizontalStrut_3.setMinimumSize(new Dimension(10, 0));
			horizontalStrut_3.setMaximumSize(new Dimension(10, 32767));
			param1Panel.add(horizontalStrut_3);
		}

		paramsPanel.add(errorLabel);

		// trebuie redimensionata fereastra, dupa nr de parametri = nr de
		// panel-uri care vor trebui sa incapa
		this.setPreferredSize(new Dimension(300, 40 * (totalSize) + 20));

		pack();
	}