コード例 #1
0
		public CheckConstraintEditorWidget (ISchemaProvider schemaProvider, SchemaActions action, CheckConstraintEditorSettings settings)
		{
			if (settings == null)
				throw new ArgumentNullException ("settings");
			if (schemaProvider == null)
				throw new ArgumentNullException ("schemaProvider");
			
			this.schemaProvider = schemaProvider;
			this.settings = settings;
			this.action = action;
			
			this.Build();

			store = new ListStore (typeof (string), typeof (string), typeof (bool), typeof (string), typeof (object));

			listCheck.Model = store;

			TreeViewColumn colName = new TreeViewColumn ();
			TreeViewColumn colColumn = new TreeViewColumn ();
			TreeViewColumn colIsColumnConstraint = new TreeViewColumn ();
			
			colName.Title = AddinCatalog.GetString ("Name");
			colColumn.Title = AddinCatalog.GetString ("Column");
			colIsColumnConstraint.Title = AddinCatalog.GetString ("Column Constraint");
			
			colColumn.MinWidth = 120; //request a bigger width
			
			CellRendererText nameRenderer = new CellRendererText ();
			columnRenderer = new CellRendererCombo ();
			CellRendererToggle isColumnConstraintRenderer = new CellRendererToggle ();

			nameRenderer.Editable = true;
			nameRenderer.Edited += new EditedHandler (NameEdited);
			
			columnRenderer.TextColumn = SortedColumnListStore.ColNameIndex;
			columnRenderer.Editable = true;
			columnRenderer.Edited += new EditedHandler (ColumnEdited);

			isColumnConstraintRenderer.Activatable = true;
			isColumnConstraintRenderer.Toggled += new ToggledHandler (IsColumnConstraintToggled);
			
			colName.PackStart (nameRenderer, true);
			colColumn.PackStart (columnRenderer, true);
			colIsColumnConstraint.PackStart (isColumnConstraintRenderer, true);

			colName.AddAttribute (nameRenderer, "text", colNameIndex);
			colColumn.AddAttribute (columnRenderer, "text", colColumnNameIndex);
			colIsColumnConstraint.AddAttribute (isColumnConstraintRenderer, "active", colIsColumnConstraintIndex);

			listCheck.AppendColumn (colName);
			if (settings.SupportsColumnConstraints)
				listCheck.AppendColumn (colColumn);
			if (settings.SupportsColumnConstraints && settings.SupportsTableConstraints)
				listCheck.AppendColumn (colIsColumnConstraint);
			
			listCheck.Selection.Changed += new EventHandler (OnSelectionChanged);
			sqlEditor.TextChanged += new EventHandler (SourceChanged);

			ShowAll ();
		}
コード例 #2
0
        public CheckConstraintEditorWidget(ISchemaProvider schemaProvider, SchemaActions action, CheckConstraintEditorSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (schemaProvider == null)
            {
                throw new ArgumentNullException("schemaProvider");
            }

            this.schemaProvider = schemaProvider;
            this.settings       = settings;
            this.action         = action;

            this.Build();

            store = new ListStore(typeof(string), typeof(string), typeof(bool), typeof(string), typeof(object));

            listCheck.Model = store;

            TreeViewColumn colName               = new TreeViewColumn();
            TreeViewColumn colColumn             = new TreeViewColumn();
            TreeViewColumn colIsColumnConstraint = new TreeViewColumn();

            colName.Title               = AddinCatalog.GetString("Name");
            colColumn.Title             = AddinCatalog.GetString("Column");
            colIsColumnConstraint.Title = AddinCatalog.GetString("Column Constraint");

            colColumn.MinWidth = 120;             //request a bigger width

            CellRendererText nameRenderer = new CellRendererText();

            columnRenderer = new CellRendererCombo();
            CellRendererToggle isColumnConstraintRenderer = new CellRendererToggle();

            nameRenderer.Editable = true;
            nameRenderer.Edited  += new EditedHandler(NameEdited);

            columnRenderer.TextColumn = SortedColumnListStore.ColNameIndex;
            columnRenderer.Editable   = true;
            columnRenderer.Edited    += new EditedHandler(ColumnEdited);

            isColumnConstraintRenderer.Activatable = true;
            isColumnConstraintRenderer.Toggled    += new ToggledHandler(IsColumnConstraintToggled);

            colName.PackStart(nameRenderer, true);
            colColumn.PackStart(columnRenderer, true);
            colIsColumnConstraint.PackStart(isColumnConstraintRenderer, true);

            colName.AddAttribute(nameRenderer, "text", colNameIndex);
            colColumn.AddAttribute(columnRenderer, "text", colColumnNameIndex);
            colIsColumnConstraint.AddAttribute(isColumnConstraintRenderer, "active", colIsColumnConstraintIndex);

            listCheck.AppendColumn(colName);
            if (settings.SupportsColumnConstraints)
            {
                listCheck.AppendColumn(colColumn);
            }
            if (settings.SupportsColumnConstraints && settings.SupportsTableConstraints)
            {
                listCheck.AppendColumn(colIsColumnConstraint);
            }

            listCheck.Selection.Changed += new EventHandler(OnSelectionChanged);
            sqlEditor.TextChanged       += new EventHandler(SourceChanged);

            ShowAll();
        }
コード例 #3
0
		public ConstraintEditorSettings ()
		{
			foreignKeySettings = new ForeignKeyConstraintEditorSettings ();
			checkSettings = new CheckConstraintEditorSettings ();
		}
コード例 #4
0
 public ConstraintEditorSettings()
 {
     foreignKeySettings = new ForeignKeyConstraintEditorSettings();
     checkSettings      = new CheckConstraintEditorSettings();
 }