當前位置: 首頁>>代碼示例>>Java>>正文


Java IPropertySource類代碼示例

本文整理匯總了Java中org.eclipse.ui.views.properties.IPropertySource的典型用法代碼示例。如果您正苦於以下問題:Java IPropertySource類的具體用法?Java IPropertySource怎麽用?Java IPropertySource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IPropertySource類屬於org.eclipse.ui.views.properties包,在下文中一共展示了IPropertySource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPropertySource

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
@Override
public IPropertySource getPropertySource ( final Object object )
{
    // this one has priority in super class
    if ( object instanceof IPropertySource )
    {
        return (IPropertySource)object;
    }

    // allow the object to adapt to IPropertySource
    if ( object instanceof EObject && ( (EObject)object ).eClass () != null )
    {
        final IPropertySource propertySource = (IPropertySource)this.adapterFactory.adapt ( object, IPropertySource.class );
        if ( propertySource != null )
        {
            return propertySource;
        }
    }

    // fall back to default behavior
    return super.getPropertySource ( object );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:23,代碼來源:ExtendedAdapterFactoryContentProvider.java

示例2: getAdapter

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
@Override 
public Object getAdapter(Class key) {
    if (key == SnapToHelper.class) {
        List<SnapToHelper> helpers = new ArrayList<SnapToHelper>();
        if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED))) {
            helpers.add(new SnapToGeometry(this));
        }
        if (Boolean.TRUE.equals(getViewer().getProperty(SnapToGrid.PROPERTY_GRID_ENABLED))) {
            helpers.add(new SnapToGrid(this));
        }
        if(helpers.size()==0) {
            return null;
        } else {
            return new CompoundSnapToHelper(helpers.toArray(new SnapToHelper[0]));
        }
    }
    if (key == IPropertySource.class) {
       return new GW4EGraphEditPartProperties(this);
    }
    return null;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:22,代碼來源:GraphPart.java

示例3: handleEvent

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public void handleEvent(Event e) {
	if (!notification)
		return;
	EdgeGW4EEditPartProperties properties = (EdgeGW4EEditPartProperties) node
			.getAdapter(IPropertySource.class);
	textWeightDecorator.hide();
	String value = textWeight.getText();
	if (value != null && value.trim().length() > 0) {
		try {
			double d = Double.parseDouble(value.trim());
			if (d<0 || d>1) {
				throw new NumberFormatException();
			}
			properties.setPropertyValue(ModelProperties.PROPERTY_EDGE_WEIGHT, value.trim());
		} catch (NumberFormatException ex) {
			textWeightDecorator.show();
		}
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:20,代碼來源:EdgeDefaultSection.java

示例4: focusLost

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
@Override
public void focusLost(FocusEvent e) {
	if (!notification)
		return;
	GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) sectionProvider
			.getAdapter(IPropertySource.class);

	txtSharedNameDecorator.hide();

	String value = textSharedName.getText();
	if (value == null || value.trim().length() == 0) {
		txtSharedNameDecorator.show();
		return;
	}
	
	properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_SHAREDNAME,value);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:18,代碼來源:VertexDefaultSection.java

示例5: setInput

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public void setInput(IWorkbenchPart part, ISelection selection) {
	super.setInput(part, selection);
	txtNameDecorator.hide();
	txtSharedNameDecorator.hide();
	Object input = ((IStructuredSelection) selection).getFirstElement();
	this.sectionProvider = (SectionProvider) input;
	AbstractGW4EEditPartProperties properties = (AbstractGW4EEditPartProperties) sectionProvider
			.getAdapter(IPropertySource.class);
	textName.setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_NAME));
	btnCheckShrd.setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_VERTEX_SHARED));
	btnCheckBlocked.setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_BLOCKED));
	textDescription.setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_DESCRIPTION));
	textRequirements.setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_VERTEX_REQUIREMENTS));
	textSharedName.setEnabled(properties.isUpdatable(ModelProperties.PROPERTY_VERTEX_SHAREDNAME));
	((GWNode) this.sectionProvider.getModel()).removePropertyChangeListener(this);
	((GWNode) this.sectionProvider.getModel()).addPropertyChangeListener(this);
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:18,代碼來源:VertexDefaultSection.java

示例6: refresh

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public void refresh() {
	notification = false;
	try {
		GW4EGraphEditPartProperties properties = (GW4EGraphEditPartProperties) node
				.getAdapter(IPropertySource.class);
		textName.setText(properties.getName());

		Set<GWNode> elements = properties.getGraph().getLinks();
		Set<GWNode> vertices = properties.getGraph().getVertices();
		elements.addAll(vertices);

		GWNode[] items = new GWNode[elements.size()];
		elements.toArray(items);
		viewer.setInput(items);

		GWNode startElement = properties.getGraph().getStartElement();
		if (startElement != null) {
			viewer.setSelection(new StructuredSelection(startElement), true);
		}
		textDescription.setText(properties.getDescription());
		textComponent.setText(properties.getComponent());
	} finally {
		notification = true;
	}
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:26,代碼來源:GraphDefaultSection.java

示例7: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:DwprofileEditor.java

示例8: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:HyexpressionEditor.java

示例9: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:HyvalidityformulaEditor.java

示例10: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:HydatavalueEditor.java

示例11: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:HymappingEditor.java

示例12: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:HyconstraintsEditor.java

示例13: getPropertySheetPage

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
開發者ID:DarwinSPL,項目名稱:DarwinSPL,代碼行數:24,代碼來源:HymanifestEditor.java

示例14: getAdapter

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
@Override
public Object getAdapter(final Object adaptableObject, final Class adapterType) {
    if (adaptableObject instanceof ChangeItem) {
        final ChangeItem changeItem = (ChangeItem) adaptableObject;
        if (adapterType == IPropertySource.class) {
            if (changeItem.getType() == ChangeItemType.CHANGESET) {
                return new ChangePropertySource(changeItem.getChange());
            } else {
                return new PendingChangePropertySource(
                    changeItem.getPendingChange(),
                    changeItem.getPropertyValues());
            }
        }
        if (adapterType == IWorkbenchAdapter.class) {
            return ChangeItemWorkbenchAdapter.INSTANCE;
        }
    }

    return null;
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:21,代碼來源:ChangeItemAdapterFactory.java

示例15: getAdapter

import org.eclipse.ui.views.properties.IPropertySource; //導入依賴的package包/類
/**
 * Method declared on IAdapterFactory.
    * Get the given adapter for the given object
 */
public Object getAdapter(Object adaptableObject, Class adapterType) {
	if (IWorkbenchAdapter.class == adapterType) {
		return getWorkbenchAdapter(adaptableObject);
	}

	if(IDeferredWorkbenchAdapter.class == adapterType) {
		 Object o = getWorkbenchAdapter(adaptableObject);
		 if(o != null && o instanceof IDeferredWorkbenchAdapter) {
		 	return o;
		 }
		 return null;
	}

	if (IPropertySource.class == adapterType) {
		return getPropertySource(adaptableObject);
	}
       
       if(IHistoryPageSource.class == adapterType) {
         return pageHistoryParticipant;
       }
       
	return null;
}
 
開發者ID:subclipse,項目名稱:subclipse,代碼行數:28,代碼來源:SVNAdapterFactory.java


注:本文中的org.eclipse.ui.views.properties.IPropertySource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。