本文整理了Java中org.protege.editor.core.ui.view.View.<init>()
方法的一些代码示例,展示了View.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.<init>()
方法的具体详情如下:
包路径:org.protege.editor.core.ui.view.View
类名称:View
方法名:<init>
[英]Creates a View
that will display the ViewComponent
instantiated by the specified tab view plugin.
[中]创建一个View
,它将显示指定选项卡视图插件实例化的ViewComponent
。
代码示例来源:origin: protegeproject/protege
private View createView(ViewComponentPlugin plugin) {
View sv = new View(plugin, workspace);
sv.pinned = true;
return sv;
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
private View createView(ViewComponentPlugin plugin) {
View sv = new View(plugin, workspace);
sv.pinned = true;
return sv;
}
代码示例来源:origin: org.protege/protege-editor-core-application
private View createView(ViewComponentPlugin plugin) {
View sv = new View(plugin, workspace);
sv.pinned = true;
return sv;
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
public JComponent createComponent(Map<String, String> properties) {
String pluginId = properties.get("pluginId");
ViewComponentPluginLoader loader = new ViewComponentPluginLoader(workspace);
for (ViewComponentPlugin plugin : loader.getPlugins()) {
if (plugin.getId().equals(pluginId)) {
return new View(plugin, workspace);
}
}
// we need to return a fully functioning view so that the close button works
return new View(getEmptyPlugin(pluginId, "Couldn't load view plugin: " + pluginId), workspace);
}
代码示例来源:origin: org.protege/protege-editor-core-application
public JComponent createComponent(Map<String, String> properties) {
String pluginId = properties.get("pluginId");
ViewComponentPluginLoader loader = new ViewComponentPluginLoader(workspace);
for (ViewComponentPlugin plugin : loader.getPlugins()) {
if (plugin.getId().equals(pluginId)) {
return new View(plugin, workspace);
}
}
// we need to return a fully functioning view so that the close button works
return new View(getEmptyPlugin(pluginId, "Couldn't load view plugin: " + pluginId), workspace);
}
代码示例来源:origin: protegeproject/protege
public JComponent createComponent(Map<String, String> properties) {
String pluginId = properties.get("pluginId");
ViewComponentPluginLoader loader = new ViewComponentPluginLoader(workspace);
for (ViewComponentPlugin plugin : loader.getPlugins()) {
if (plugin.getId().equals(pluginId)) {
return new View(plugin, workspace);
}
}
// we need to return a fully functioning view so that the close button works
String msg = String.format(
"<html><body>" +
"<div style='font-weight: bold; padding-bottom: 20px;'>This view could not be loaded because its content is " +
"provided by a view " +
"plugin that could not be found.</div>" +
"<div style='padding-bottom: 20px;'>" +
"This problem may have been caused because the plugin is not installed or it may have been " +
"caused by incompatible changes to the plugin in question.</div>" +
"<div>Please check that the relevant plugin is installed. You can also try resetting " +
"the tab to its default state to see if " +
"this solves the issue.</div>" +
"</body></html>"
);
return new View(getEmptyPlugin(pluginId, msg), workspace);
}
代码示例来源:origin: protegeproject/protege
public View showResultsView(ViewComponentPlugin plugin, boolean replace, int location) {
try {
ViewHolder viewHolder;
if (location == BOTTOM_RESULTS_VIEW) {
viewHolder = bottomResultsViewHolder;
}
else {
viewHolder = leftResultsViewHolder;
}
if (replace) {
View v = viewHolder.getView(plugin.getId());
if (v != null) {
v.closeView();
}
}
View view = new View(plugin, this);
ViewComponent viewComponent = plugin.newInstance();
viewComponent.setup(plugin);
viewHolder.addView(view);
return view;
}
catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
logger.error("An error occurred whilst instantiating the results view: {}", e);
}
return null;
}
代码示例来源:origin: org.protege/protege-editor-owl
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(new HierarchyListener(){
public void hierarchyChanged(HierarchyEvent event) {
if (!registeredListener){
addSelectionListener(new ChangeListener(){
public void stateChanged(ChangeEvent event) {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
}
});
registeredListener = true;
}
}
});
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.owl
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(new HierarchyListener(){
public void hierarchyChanged(HierarchyEvent event) {
if (!registeredListener){
addSelectionListener(new ChangeListener(){
public void stateChanged(ChangeEvent event) {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
}
});
registeredListener = true;
}
}
});
}
代码示例来源:origin: protegeproject/protege
/**
* Shows the view that is identified by the specified id.
* @param viewId The id of the view to be shown.
* @return The <code>View</code> that was shown. If the
* <code>View</code> could not be shown then the return
* value is <code>null</code>.
*/
public View showView(String viewId) {
ViewComponentPlugin plugin = pluginMap.get(viewId);
if (plugin == null) {
return null;
}
// We need to get hold of the views tab
Workspace ws = plugin.getWorkspace();
if (ws instanceof TabbedWorkspace) {
WorkspaceTab tab = ((TabbedWorkspace) ws).getSelectedTab();
// if (tab instanceof WorkspaceViewsTab) {
View view = new View(plugin, plugin.getWorkspace());
DynamicConfigPanel pan = new DynamicConfigPanel(tab);
pan.setCurrentComponent(view, plugin.getLabel());
pan.activate();
// ((WorkspaceViewsTab) tab).getViewsPane().addView(view, plugin.getLabel());
// }
}
return null;
}
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
/**
* Shows the view that is identified by the specified id.
* @param viewId The id of the view to be shown.
* @return The <code>View</code> that was shown. If the
* <code>View</code> could not be shown then the return
* value is <code>null</code>.
*/
public View showView(String viewId) {
ViewComponentPlugin plugin = pluginMap.get(viewId);
if (plugin == null) {
return null;
}
// We need to get hold of the views tab
Workspace ws = plugin.getWorkspace();
if (ws instanceof TabbedWorkspace) {
WorkspaceTab tab = ((TabbedWorkspace) ws).getSelectedTab();
// if (tab instanceof WorkspaceViewsTab) {
View view = new View(plugin, plugin.getWorkspace());
DynamicConfigPanel pan = new DynamicConfigPanel(tab);
pan.setCurrentComponent(view, plugin.getLabel());
pan.activate();
// ((WorkspaceViewsTab) tab).getViewsPane().addView(view, plugin.getLabel());
// }
}
return null;
}
}
代码示例来源:origin: org.protege/protege-editor-core-application
/**
* Shows the view that is identified by the specified id.
* @param viewId The id of the view to be shown.
* @return The <code>View</code> that was shown. If the
* <code>View</code> could not be shown then the return
* value is <code>null</code>.
*/
public View showView(String viewId) {
ViewComponentPlugin plugin = pluginMap.get(viewId);
if (plugin == null) {
return null;
}
// We need to get hold of the views tab
Workspace ws = plugin.getWorkspace();
if (ws instanceof TabbedWorkspace) {
WorkspaceTab tab = ((TabbedWorkspace) ws).getSelectedTab();
// if (tab instanceof WorkspaceViewsTab) {
View view = new View(plugin, plugin.getWorkspace());
DynamicConfigPanel pan = new DynamicConfigPanel(tab);
pan.setCurrentComponent(view, plugin.getLabel());
pan.activate();
// ((WorkspaceViewsTab) tab).getViewsPane().addView(view, plugin.getLabel());
// }
}
return null;
}
}
代码示例来源:origin: edu.stanford.protege/protege-editor-owl
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
// setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
// BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(event -> {
if (!registeredListener){
addSelectionListener(e -> {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
});
registeredListener = true;
}
});
}
代码示例来源:origin: protegeproject/protege
protected void createUI() {
setLayout(new BorderLayout());
ViewComponentPlugin plugin = getViewComponentPlugin();
view = new View(plugin, editorKit.getWorkspace());
view.setPinned(true);
view.setSyncronizing(false);
view.createUI();
view.setShowViewBanner(false);
add(view);
// setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY),
// BorderFactory.createEmptyBorder(2, 2, 2, 2)));
// only attach change listeners once the component is shown
// (as those that use a view component are lazilly created)
view.addHierarchyListener(event -> {
if (!registeredListener){
addSelectionListener(e -> {
boolean valid = getSelectedObjects() != null && !getSelectedObjects().isEmpty();
for (InputVerificationStatusChangedListener l : validateListeners){
l.verifiedStatusChanged(valid);
}
isValid = valid;
});
registeredListener = true;
}
});
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
View view = new View(plugin, this);
ViewComponent viewComponent = plugin.newInstance();
viewComponent.setup(plugin);
代码示例来源:origin: org.protege/protege-editor-core-application
View view = new View(plugin, this);
ViewComponent viewComponent = plugin.newInstance();
viewComponent.setup(plugin);
内容来源于网络,如有侵权,请联系作者删除!