Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 168886 Details for
Bug 313308
[extract method] NPE during extract method refactoring
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
File that causes the exception
OntologyView.java (text/plain), 4.46 KB, created by
Ulli Hafner
on 2010-05-18 05:54:48 EDT
(
hide
)
Description:
File that causes the exception
Filename:
MIME Type:
Creator:
Ulli Hafner
Created:
2010-05-18 05:54:48 EDT
Size:
4.46 KB
patch
obsolete
>package de.faktorlogik.prototyp.internal.views; > >import java.util.Locale; > >import net.ffxml.swtforms.builder.DefaultFormBuilder; >import net.ffxml.swtforms.layout.FormLayout; > >import org.apache.commons.lang.StringUtils; >import org.eclipse.core.databinding.observable.value.IValueChangeListener; >import org.eclipse.core.databinding.observable.value.ValueChangeEvent; >import org.eclipse.jface.action.IStatusLineManager; >import org.eclipse.jface.action.IToolBarManager; >import org.eclipse.swt.SWT; >import org.eclipse.swt.custom.SashForm; >import org.eclipse.swt.layout.FillLayout; >import org.eclipse.swt.widgets.Composite; >import org.eclipse.ui.part.ViewPart; >import org.eclipse.zest.core.viewers.AbstractZoomableViewer; >import org.eclipse.zest.core.viewers.GraphViewer; >import org.eclipse.zest.core.viewers.IZoomableWorkbenchPart; > >import static de.faktorlogik.eclipse.ui.LayoutFactory.*; > >import de.faktorlogik.eclipse.ui.LayoutFactory; >import de.faktorlogik.prototyp.internal.ApplicationActionBarAdvisor; > >/** > * Main view that shows the navigation pane and the results view. > */ >public class OntologyView extends ViewPart implements IZoomableWorkbenchPart { > /** ID of this view. */ > public static final String ID = "de.faktorlogik.prototyp.navigationView"; //$NON-NLS-1$ > > /** The presentation model for this view. */ > private final OntologyModel model = new OntologyModel(); > > private GraphViewer focusControl; > > /** > * Creates the controls of this view. Also creates the model and binds the > * model values to the view controls. > * > * @param parent > * the parent container > */ > @Override > public void createPartControl(final Composite parent) { > Locale.setDefault(Locale.GERMAN); // TODO: this should not be required > > FormLayout mainLayout = new LayoutFactory().withColumns(GROW).and().withRows(PREF, GROW).create(); > Composite mainPane = new Composite(parent, SWT.NONE); > DefaultFormBuilder builder = new DefaultFormBuilder(mainLayout, mainPane); > > ProgressComponent progress = new ProgressComponent(model); > builder.add(progress.createControl(mainPane)); > builder.nextLine(); > > SashForm horizontalSash = new SashForm(mainPane, SWT.HORIZONTAL); > horizontalSash.setLayout(new FillLayout()); > builder.add(horizontalSash); > > SashForm leftVerticalSash = new SashForm(horizontalSash, SWT.VERTICAL); > leftVerticalSash.setLayout(new FillLayout()); > > NavigationGraph graph = new NavigationGraph(model); > focusControl = graph.createControl(leftVerticalSash); > > ClausesModel resultsModel = new ClausesModel(model.getOntology(), model.getAxiomMapper()); > ClausesComponent resultsComponent = new ClausesComponent(resultsModel); > resultsComponent.createControls(leftVerticalSash); > > leftVerticalSash.setWeights(new int[] {60, 40}); // NOCHECKSTYLE > > ConsequencesComponent goalComponent = new ConsequencesComponent(model); > goalComponent.createControls(horizontalSash); > > horizontalSash.setWeights(new int[] {70, 30}); // NOCHECKSTYLE > > getSite().setSelectionProvider(focusControl); > > resultsModel.getSelectedClause().addValueChangeListener(new StatusBarUpdater()); > > IToolBarManager mainToolBar = ApplicationActionBarAdvisor.getMainToolBar(); > mainToolBar.add(new ZoomAction(focusControl)); > mainToolBar.add(new LayoutMenu(focusControl)); > mainToolBar.add(new FilterUnknownAxiomsAction(resultsModel)); > mainToolBar.update(true); > } > > /** > * Passing the focus request to the viewer's control. > */ > @Override > public void setFocus() { > focusControl.getGraphControl().setFocus(); > } > > /** {@inheritDoc} */ > @Override > public AbstractZoomableViewer getZoomableViewer() { > return focusControl; > } > > /** > * Updates the status bar with the selected clause. > */ > private final class StatusBarUpdater implements IValueChangeListener { > @Override > public void handleValueChange(final ValueChangeEvent event) { > IStatusLineManager status = getViewSite().getActionBars().getStatusLineManager(); > Object observableValue = event.getObservableValue().getValue(); > String message = StringUtils.EMPTY; > if (observableValue instanceof Clause) { > Clause clause = (Clause)observableValue; > message = clause.getDefinition(); > } > status.setMessage(message); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 313308
: 168886